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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
window_QT.cpp
modules/highgui/src/window_QT.cpp
+9
-5
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)
...
@@ -442,14 +442,11 @@ CvButtonbar* icvFindButtonbarByName( const char* button_name,QBoxLayout* layout)
int
icvInitSystem
(
int
*
c
,
char
**
v
)
int
icvInitSystem
(
int
*
c
,
char
**
v
)
{
{
static
int
wasInitialized
=
0
;
//"For any GUI application using Qt, there is precisely one QApplication object"
if
(
!
QApplication
::
instance
())
// check initialization status
if
(
!
wasInitialized
)
{
{
new
QApplication
(
*
c
,
v
);
new
QApplication
(
*
c
,
v
);
wasInitialized
=
1
;
qDebug
()
<<
"init done"
;
qDebug
()
<<
"init done"
;
#if defined( HAVE_QT_OPENGL )
#if defined( HAVE_QT_OPENGL )
...
@@ -700,6 +697,7 @@ CV_IMPL void cvShowImage( const char* name, const CvArr* arr )
...
@@ -700,6 +697,7 @@ CV_IMPL void cvShowImage( const char* name, const CvArr* arr )
GuiReceiver
::
GuiReceiver
()
:
_bTimeOut
(
false
),
nb_windows
(
0
)
GuiReceiver
::
GuiReceiver
()
:
_bTimeOut
(
false
),
nb_windows
(
0
)
{
{
doesExternalQAppExist
=
(
QApplication
::
instance
()
!=
0
);
icvInitSystem
(
&
parameterSystemC
,
parameterSystemV
);
icvInitSystem
(
&
parameterSystemC
,
parameterSystemV
);
timer
=
new
QTimer
;
timer
=
new
QTimer
;
...
@@ -714,8 +712,11 @@ void GuiReceiver::isLastWindow()
...
@@ -714,8 +712,11 @@ void GuiReceiver::isLastWindow()
{
{
delete
guiMainThread
;
//delete global_control_panel too
delete
guiMainThread
;
//delete global_control_panel too
guiMainThread
=
NULL
;
guiMainThread
=
NULL
;
if
(
!
doesExternalQAppExist
)
{
qApp
->
quit
();
qApp
->
quit
();
}
}
}
}
}
GuiReceiver
::~
GuiReceiver
()
GuiReceiver
::~
GuiReceiver
()
...
@@ -983,6 +984,9 @@ void GuiReceiver::destroyAllWindow()
...
@@ -983,6 +984,9 @@ void GuiReceiver::destroyAllWindow()
if
(
multiThreads
)
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
();
qApp
->
closeAllWindows
();
}
else
{
}
else
{
...
...
modules/highgui/src/window_QT.h
View file @
0565a945
...
@@ -121,6 +121,7 @@ public:
...
@@ -121,6 +121,7 @@ public:
private
:
private
:
int
nb_windows
;
int
nb_windows
;
bool
doesExternalQAppExist
;
public
slots
:
public
slots
:
void
createWindow
(
QString
name
,
int
flags
=
0
);
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