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
0565a945
Commit
0565a945
authored
Jun 16, 2011
by
Ilya Lysenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: fixed using of OpenCV in another Qt app (patch #919)
parent
8d8ef596
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
window_QT.cpp
modules/highgui/src/window_QT.cpp
+10
-6
window_QT.h
modules/highgui/src/window_QT.h
+1
-0
No files found.
modules/highgui/src/window_QT.cpp
View file @
0565a945
...
...
@@ -442,14 +442,11 @@ CvButtonbar* icvFindButtonbarByName( const char* button_name,QBoxLayout* layout)
int
icvInitSystem
(
int
*
c
,
char
**
v
)
{
static
int
wasInitialized
=
0
;
// check initialization status
if
(
!
wasInitialized
)
//"For any GUI application using Qt, there is precisely one QApplication object"
if
(
!
QApplication
::
instance
())
{
new
QApplication
(
*
c
,
v
);
wasInitialized
=
1
;
qDebug
()
<<
"init done"
;
#if defined( HAVE_QT_OPENGL )
...
...
@@ -700,6 +697,7 @@ CV_IMPL void cvShowImage( const char* name, const CvArr* arr )
GuiReceiver
::
GuiReceiver
()
:
_bTimeOut
(
false
),
nb_windows
(
0
)
{
doesExternalQAppExist
=
(
QApplication
::
instance
()
!=
0
);
icvInitSystem
(
&
parameterSystemC
,
parameterSystemV
);
timer
=
new
QTimer
;
...
...
@@ -714,7 +712,10 @@ void GuiReceiver::isLastWindow()
{
delete
guiMainThread
;
//delete global_control_panel too
guiMainThread
=
NULL
;
qApp
->
quit
();
if
(
!
doesExternalQAppExist
)
{
qApp
->
quit
();
}
}
}
...
...
@@ -983,6 +984,9 @@ void GuiReceiver::destroyAllWindow()
if
(
multiThreads
)
{
// WARNING: this could even close windows from an external parent app
//#TODO check externalQAppExists and in case it does, close windows carefully,
// i.e. apply the className-check from below...
qApp
->
closeAllWindows
();
}
else
{
...
...
modules/highgui/src/window_QT.h
View file @
0565a945
...
...
@@ -121,6 +121,7 @@ public:
private
:
int
nb_windows
;
bool
doesExternalQAppExist
;
public
slots
:
void
createWindow
(
QString
name
,
int
flags
=
0
);
...
...
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