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
be292046
Commit
be292046
authored
Jun 12, 2010
by
Yannick Verdie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working on QT change/get win property (done)
Fullscreen done change autoresize dynamically done
parent
e71c5e87
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
15 deletions
+77
-15
precomp.hpp
modules/highgui/src/precomp.hpp
+9
-1
window.cpp
modules/highgui/src/window.cpp
+3
-3
window_QT.cpp
modules/highgui/src/window_QT.cpp
+63
-11
window_QT.h
modules/highgui/src/window_QT.h
+2
-0
No files found.
modules/highgui/src/precomp.hpp
View file @
be292046
...
...
@@ -165,11 +165,19 @@ CvVideoWriter* cvCreateVideoWriter_GStreamer( const char* filename, int fourcc,
double
cvGetModeWindow_W32
(
const
char
*
name
);
double
cvGetModeWindow_GTK
(
const
char
*
name
);
double
cvGetModeWindow_CARBON
(
const
char
*
name
);
double
cvGetModeWindow_QT
(
const
char
*
name
);
void
cvSetModeWindow_W32
(
const
char
*
name
,
double
prop_value
);
void
cvSetModeWindow_GTK
(
const
char
*
name
,
double
prop_value
);
void
cvSetModeWindow_CARBON
(
const
char
*
name
,
double
prop_value
);
//for QT
#if defined (HAVE_QT)
double
cvGetModeWindow_QT
(
const
char
*
name
);
void
cvSetModeWindow_QT
(
const
char
*
name
,
double
prop_value
);
double
cvGetPropWindow_QT
(
const
char
*
name
);
void
cvSetPropWindow_QT
(
const
char
*
name
,
double
prop_value
);
#endif
/*namespace cv
{
...
...
modules/highgui/src/window.cpp
View file @
be292046
...
...
@@ -66,7 +66,7 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
case
CV_WND_PROP_AUTOSIZE
:
#if defined (HAVE_QT)
//cvChangeSize
Window_QT(name,prop_value);
cvSetProp
Window_QT
(
name
,
prop_value
);
#endif
break
;
...
...
@@ -102,9 +102,9 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
return
-
1
;
#if defined (HAVE_QT)
//cvGetSizeWindow_QT(name,prop_valu
e);
return
cvGetPropWindow_QT
(
nam
e
);
#else
return
-
1
;
return
-
1
;
#endif
default:
...
...
modules/highgui/src/window_QT.cpp
View file @
be292046
...
...
@@ -53,7 +53,28 @@ QWaitCondition key_pressed;
QMutex
mutexKey
;
//end static and global
//end declaration
double
cvGetPropWindow_QT
(
const
char
*
name
)
{
double
result
=
-
1
;
QMetaObject
::
invokeMethod
(
&
guiMainThread
,
"getPropWindow"
,
//Qt::DirectConnection,
Qt
::
AutoConnection
,
Q_RETURN_ARG
(
double
,
result
),
Q_ARG
(
QString
,
QString
(
name
)));
return
result
;
}
void
cvSetPropWindow_QT
(
const
char
*
name
,
double
prop_value
)
{
QMetaObject
::
invokeMethod
(
&
guiMainThread
,
"setPropWindow"
,
Qt
::
AutoConnection
,
Q_ARG
(
QString
,
QString
(
name
)),
Q_ARG
(
double
,
prop_value
));
}
void
cvSetModeWindow_QT
(
const
char
*
name
,
double
prop_value
)
{
QMetaObject
::
invokeMethod
(
&
guiMainThread
,
...
...
@@ -65,7 +86,7 @@ void cvSetModeWindow_QT(const char* name, double prop_value)
double
cvGetModeWindow_QT
(
const
char
*
name
)
{
double
result
;
double
result
=
-
1
;
QMetaObject
::
invokeMethod
(
&
guiMainThread
,
"isFullScreen"
,
...
...
@@ -405,6 +426,44 @@ GuiReceiver::GuiReceiver() : _bTimeOut(false)
qApp
->
setQuitOnLastWindowClosed
(
false
);
//maybe the user would like to access this setting
}
double
GuiReceiver
::
getPropWindow
(
QString
name
)
{
QPointer
<
CvWindow
>
w
=
icvFindWindowByName
(
name
.
toLatin1
().
data
()
);
if
(
!
w
)
return
-
1
;
return
(
double
)
w
->
flags
;
}
void
GuiReceiver
::
setPropWindow
(
QString
name
,
double
arg2
)
{
QPointer
<
CvWindow
>
w
=
icvFindWindowByName
(
name
.
toLatin1
().
data
()
);
if
(
!
w
)
return
;
int
flags
=
(
int
)
arg2
;
if
(
w
->
flags
==
flags
)
//nothing to do
return
;
switch
(
flags
)
{
case
CV_WINDOW_NORMAL
:
w
->
layout
->
setSizeConstraint
(
QLayout
::
SetMinAndMaxSize
);
w
->
flags
=
flags
;
break
;
case
CV_WINDOW_AUTOSIZE
:
w
->
layout
->
setSizeConstraint
(
QLayout
::
SetFixedSize
);
w
->
flags
=
flags
;
break
;
default
:
;
}
}
double
GuiReceiver
::
isFullScreen
(
QString
name
)
{
QPointer
<
CvWindow
>
w
=
icvFindWindowByName
(
name
.
toLatin1
().
data
()
);
...
...
@@ -602,16 +661,9 @@ CvTrackbar::CvTrackbar(CvWindow* arg, QString name, int* value, int count, CvTra
QObject
::
connect
(
slider
,
SIGNAL
(
valueChanged
(
int
)
),
this
,
SLOT
(
update
(
int
)
)
);
//if I connect those two signals in not-multiThreads mode,
//the code crashes when we move the trackbar and then click on the button, ... why ?
//so I disable the button
if
(
multiThreads
)
QObject
::
connect
(
label
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
createDialog
()
));
else
label
->
setEnabled
(
false
);
QObject
::
connect
(
label
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
createDialog
()
));
label
->
setStyleSheet
(
"QPushButton:disabled {color: black}"
);
//
label->setStyleSheet("QPushButton:disabled {color: black}");
addWidget
(
label
);
//name + value
addWidget
(
slider
);
//slider
...
...
modules/highgui/src/window_QT.h
View file @
be292046
...
...
@@ -100,6 +100,8 @@ public slots:
void
timeOut
();
void
toggleFullScreen
(
QString
name
,
double
flags
);
double
isFullScreen
(
QString
name
);
double
getPropWindow
(
QString
name
);
void
setPropWindow
(
QString
name
,
double
flags
);
};
class
CvTrackbar
:
public
QHBoxLayout
...
...
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