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
662c58ca
Commit
662c58ca
authored
Aug 15, 2010
by
Yannick Verdie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt bug fixed with cvWaitKey(0)
parent
dec6f2c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
window_QT.cpp
modules/highgui/src/window_QT.cpp
+18
-5
window_QT.h
modules/highgui/src/window_QT.h
+1
-1
No files found.
modules/highgui/src/window_QT.cpp
View file @
662c58ca
...
...
@@ -1979,8 +1979,8 @@ ViewPort::ViewPort(CvWindow* arg, int arg2, int arg3)
if
(
mode_display
==
CV_MODE_OPENGL
)
{
//QGLWidget* w
GL = new QGLWidget(QGLFormat(QGL::SampleBuffers));
setViewport
(
new
QGLWidget
(
QGLFormat
(
QGL
::
SampleBuffers
))
);
my
GL
=
new
QGLWidget
(
QGLFormat
(
QGL
::
SampleBuffers
));
setViewport
(
myGL
);
if
(
param_keepRatio
==
CV_WINDOW_KEEPRATIO
)
{
//TODO: fix this bug:
...
...
@@ -2027,6 +2027,14 @@ ViewPort::~ViewPort()
if
(
image2Draw_ipl
)
cvReleaseImage
(
&
image2Draw_ipl
);
#if defined( HAVE_QT_OPENGL )
if
(
myGL
)
delete
myGL
;
#endif;
qDebug
()
<<
"kill vieport"
;
delete
timerDisplay
;
}
...
...
@@ -2198,13 +2206,16 @@ void ViewPort::updateImage(void* arr)
//the ipl image in qt format (with shared memory)
//image2Draw_qt = QImage((uchar*) image2Draw_ipl->imageData, image2Draw_ipl->width, image2Draw_ipl->height,QImage::Format_RGB888);
nbChannelOriginImage
=
tempImage
->
nChannels
;
//
nbChannelOriginImage = tempImage->nChannels;
updateGeometry
();
}
cvCvtColor
(
tempImage
,
image2Draw_ipl
,
CV_BGR2RGB
);
//cvConvertImage(tempImage,image2Draw_ipl,CV_CVTIMG_SWAP_RB );
nbChannelOriginImage
=
tempImage
->
nChannels
;
//cvCvtColor(tempImage,image2Draw_ipl,CV_BGR2RGB);//will not work if tempImage is 1 channel !!
cvConvertImage
(
tempImage
,
image2Draw_ipl
,
CV_CVTIMG_SWAP_RB
);
viewport
()
->
update
();
}
...
...
@@ -2289,6 +2300,7 @@ void ViewPort::moveView(QPointF delta)
{
param_matrixWorld
.
translate
(
delta
.
x
(),
delta
.
y
());
controlImagePosition
();
viewport
()
->
update
();
}
//factor is -0.5 (zoom out) or 0.5 (zoom in)
...
...
@@ -2331,6 +2343,7 @@ void ViewPort::scaleView(qreal factor,QPointF center)
void
ViewPort
::
wheelEvent
(
QWheelEvent
*
event
)
{
scaleView
(
-
event
->
delta
()
/
240.0
,
event
->
pos
());
viewport
()
->
update
();
}
void
ViewPort
::
mousePressEvent
(
QMouseEvent
*
event
)
...
...
modules/highgui/src/window_QT.h
View file @
662c58ca
...
...
@@ -438,7 +438,7 @@ private:
void
icvmouseProcessing
(
QPointF
pt
,
int
cv_event
,
int
flags
);
#if defined( HAVE_QT_OPENGL )
QPointer
<
Open
GLWidget
>
myGL
;
QPointer
<
Q
GLWidget
>
myGL
;
double
angle
;
double
zmin
;
double
zmax
;
...
...
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