Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
8f8aba9c
Commit
8f8aba9c
authored
Jul 30, 2010
by
Yannick Verdie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed Qt bug
parent
3ffee6aa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
20 deletions
+26
-20
CMakeLists.txt
CMakeLists.txt
+7
-5
highgui_c.h
modules/highgui/include/opencv2/highgui/highgui_c.h
+9
-10
window_QT.cpp
modules/highgui/src/window_QT.cpp
+8
-4
window_QT.h
modules/highgui/src/window_QT.h
+2
-1
No files found.
CMakeLists.txt
View file @
8f8aba9c
...
...
@@ -519,13 +519,15 @@ if (WITH_QT)
add_definitions
(
-DHAVE_QT
)
#We need to define te macro this way, using cvconfig.h.cmake does not work
find_package
(
OpenGL QUIET
)
#if (NOT WIN32) #WIN32 always detect OpenGL, so I disabled it.
if
(
OPENGL_INCLUDE_DIR
)
if
(
NOT WIN32
)
#on my Windows, OPENGL_FOUND was true but this path was empty
if
(
QT_QTOPENGL_FOUND AND OPENGL_FOUND
)
set
(
HAVE_QT_OPENGL 1
)
add_definitions
(
-DHAVE_QT_OPENGL
)
endif
()
set
(
HAVE_QT_OPENGL 1
)
add_definitions
(
-DHAVE_QT_OPENGL
)
endif
()
endif
()
endif
()
endif
()
...
...
modules/highgui/include/opencv2/highgui/highgui_c.h
View file @
8f8aba9c
...
...
@@ -72,11 +72,6 @@ enum { CV_STYLE_NORMAL = 0,//QFont::StyleNormal,
};
/* ---------*/
//the first bit is for normal or autoresize
//CV_WINDOW_NORMAL = 0x00000000 and CV_WINDOW_AUTOSIZE = 0x00000001
//the secont bit is for the gui mode (normal or extended)
enum
{
CV_GUI_EXPANDED
=
0x00000000
,
CV_GUI_NORMAL
=
0x00000010
};
//for color cvScalar(blue_component, green_component, red\_component[, alpha_component])
//and alpha= 0 <-> 0xFF (not transparent <-> transparent)
CVAPI
(
CvFont
)
cvFont_Qt
(
const
char
*
nameFont
,
int
pointSize
CV_DEFAULT
(
-
1
),
CvScalar
color
CV_DEFAULT
(
cvScalarAll
(
0
)),
int
weight
CV_DEFAULT
(
CV_FONT_NORMAL
),
int
style
CV_DEFAULT
(
CV_STYLE_NORMAL
),
int
spacing
CV_DEFAULT
(
0
));
...
...
@@ -114,13 +109,17 @@ enum
CV_WND_PROP_ASPECTRATIO
=
2
,
//to change/get window's aspectratio property
//
//These 2 flags are used by cvNamedWindow and cvSet/GetWindowProperty
CV_WINDOW_NORMAL
=
0
,
//the user can resize the window (no constraint)
CV_WINDOW_AUTOSIZE
=
1
,
//the user cannot resize the window, the size is constrainted by the image displayed
CV_WINDOW_NORMAL
=
0
x00000000
,
//the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size
CV_WINDOW_AUTOSIZE
=
0x0000000
1
,
//the user cannot resize the window, the size is constrainted by the image displayed
//
//These 2 flags are used by cvNamedWindow and cvSet/GetWindowProperty
//Those flags are only for Qt
CV_GUI_EXPANDED
=
0x00000000
,
//status bar and tool bar
CV_GUI_NORMAL
=
0x00000010
,
//old fashious way
//
//These 3 flags are used by cvNamedWindow and cvSet/GetWindowProperty
CV_WINDOW_FULLSCREEN
=
1
,
//change the window to fullscreen
CV_WINDOW_FREERATIO
=
0
,
//the image expends as much as it can (no ratio constraint)
CV_WINDOW_KEEPRATIO
=
1
//the ration image is respected.
CV_WINDOW_FREERATIO
=
0
x00000100
,
//the image expends as much as it can (no ratio constraint)
CV_WINDOW_KEEPRATIO
=
0x00000000
//the ration image is respected.
};
/* create window */
...
...
modules/highgui/src/window_QT.cpp
View file @
8f8aba9c
...
...
@@ -394,6 +394,9 @@ CvTrackbar* icvFindTrackbarByName( const char* name_trackbar, const char* name_w
QString
nameQt
(
name_trackbar
);
CvBar
*
result
=
NULL
;
if
(
!
name_window
&&
global_control_panel
)
//window name is null and we have a control panel
layout
=
global_control_panel
->
myLayout
;
if
(
!
layout
)
{
QPointer
<
CvWindow
>
w
=
icvFindWindowByName
(
name_window
);
...
...
@@ -1343,6 +1346,7 @@ CvWindow::CvWindow(QString arg, int arg2)
param_flags
=
arg2
&
0x0000000F
;
param_gui_mode
=
arg2
&
0x000000F0
;
param_ratio_mode
=
arg2
&
0x00000F00
;
setAttribute
(
Qt
::
WA_DeleteOnClose
);
//in other case, does not release memory
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
@@ -1360,7 +1364,7 @@ CvWindow::CvWindow(QString arg, int arg2)
#if defined( HAVE_QT_OPENGL )
mode_display
=
CV_MODE_OPENGL
;
#endif
createView
(
mode_display
);
createView
(
mode_display
,
param_ratio_mode
);
//3: shortcuts and actions
createActions
();
...
...
@@ -1611,10 +1615,10 @@ void CvWindow::createShortcuts()
QObject
::
connect
(
vect_QShortcuts
[
9
],
SIGNAL
(
activated
()),
this
,
SLOT
(
displayPropertiesWin
()
));
}
void
CvWindow
::
createView
(
int
mode
)
void
CvWindow
::
createView
(
int
mode
,
int
ratio
)
{
//mode = CV_MODE_NORMAL or CV_MODE_OPENGL
myview
=
new
ViewPort
(
this
,
mode
,
CV_WINDOW_KEEPRATIO
);
//parent, mode_display, keep_aspect_ratio
myview
=
new
ViewPort
(
this
,
mode
,
ratio
);
//parent, mode_display, keep_aspect_ratio
myview
->
setAlignment
(
Qt
::
AlignHCenter
);
}
...
...
@@ -1806,7 +1810,7 @@ void CvWindow::icvSaveTrackbars(QSettings *settings)
ViewPort
::
ViewPort
(
CvWindow
*
arg
,
int
arg2
,
int
arg3
)
{
centralWidget
=
arg
,
setParent
(
centralWidget
);
setParent
(
centralWidget
);
mode_display
=
arg2
;
param_keepRatio
=
arg3
;
...
...
modules/highgui/src/window_QT.h
View file @
8f8aba9c
...
...
@@ -291,6 +291,7 @@ public:
CvWinProperties
*
parameters_window
;
int
param_flags
;
int
param_gui_mode
;
int
param_ratio_mode
;
QVector
<
QAction
*>
vect_QActions
;
...
...
@@ -307,7 +308,7 @@ private:
void
createShortcuts
();
void
createActions
();
void
createToolBar
();
void
createView
(
int
mode
);
void
createView
(
int
display_mode
,
int
ratio_
mode
);
void
createStatusBar
();
void
createGlobalLayout
();
void
createBarLayout
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment