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
e11a77cb
Commit
e11a77cb
authored
Jul 12, 2010
by
Yannick Verdie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use sleep instead of usleep on window
parent
f2971aeb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
window_QT.cpp
modules/highgui/src/window_QT.cpp
+18
-0
No files found.
modules/highgui/src/window_QT.cpp
View file @
e11a77cb
...
...
@@ -230,6 +230,8 @@ CV_IMPL int cvWaitKey( int arg )
if
(
arg
>
0
)
timer
.
start
(
arg
);
//QMutex dummy;
while
(
!
guiMainThread
.
_bTimeOut
)
{
qApp
->
processEvents
(
QEventLoop
::
AllEvents
);
...
...
@@ -245,9 +247,25 @@ CV_IMPL int cvWaitKey( int arg )
mutexKey
.
unlock
();
if
(
result
!=-
1
)
{
break
;
}
else
{
/*
* //will not work, I broke the event loop !!!!
dummy.lock();
QWaitCondition waitCondition;
waitCondition.wait(&dummy, 2);
*/
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
sleep
(
2
);
#else
usleep
(
2
);
//to decrease CPU usage
#endif
}
}
guiMainThread
.
_bTimeOut
=
false
;
}
...
...
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