Qt bug fixed with cvWaitKey(0)
This commit is contained in:
parent
dec6f2c393
commit
662c58ca86
@ -1979,8 +1979,8 @@ ViewPort::ViewPort(CvWindow* arg, int arg2, int arg3)
|
|||||||
|
|
||||||
if ( mode_display == CV_MODE_OPENGL)
|
if ( mode_display == CV_MODE_OPENGL)
|
||||||
{
|
{
|
||||||
//QGLWidget* wGL = new QGLWidget(QGLFormat(QGL::SampleBuffers));
|
myGL = new QGLWidget(QGLFormat(QGL::SampleBuffers));
|
||||||
setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
setViewport(myGL);
|
||||||
if (param_keepRatio == CV_WINDOW_KEEPRATIO)
|
if (param_keepRatio == CV_WINDOW_KEEPRATIO)
|
||||||
{
|
{
|
||||||
//TODO: fix this bug:
|
//TODO: fix this bug:
|
||||||
@ -2027,6 +2027,14 @@ ViewPort::~ViewPort()
|
|||||||
if (image2Draw_ipl)
|
if (image2Draw_ipl)
|
||||||
cvReleaseImage(&image2Draw_ipl);
|
cvReleaseImage(&image2Draw_ipl);
|
||||||
|
|
||||||
|
|
||||||
|
#if defined( HAVE_QT_OPENGL )
|
||||||
|
if (myGL)
|
||||||
|
delete myGL;
|
||||||
|
#endif;
|
||||||
|
|
||||||
|
qDebug()<<"kill vieport";
|
||||||
|
|
||||||
delete timerDisplay;
|
delete timerDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2198,13 +2206,16 @@ void ViewPort::updateImage(void* arr)
|
|||||||
//the ipl image in qt format (with shared memory)
|
//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);
|
//image2Draw_qt = QImage((uchar*) image2Draw_ipl->imageData, image2Draw_ipl->width, image2Draw_ipl->height,QImage::Format_RGB888);
|
||||||
|
|
||||||
nbChannelOriginImage = tempImage->nChannels;
|
//nbChannelOriginImage = tempImage->nChannels;
|
||||||
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
cvCvtColor(tempImage,image2Draw_ipl,CV_BGR2RGB);
|
nbChannelOriginImage = tempImage->nChannels;
|
||||||
//cvConvertImage(tempImage,image2Draw_ipl,CV_CVTIMG_SWAP_RB );
|
|
||||||
|
|
||||||
|
//cvCvtColor(tempImage,image2Draw_ipl,CV_BGR2RGB);//will not work if tempImage is 1 channel !!
|
||||||
|
cvConvertImage(tempImage,image2Draw_ipl,CV_CVTIMG_SWAP_RB );
|
||||||
|
|
||||||
viewport()->update();
|
viewport()->update();
|
||||||
}
|
}
|
||||||
@ -2289,6 +2300,7 @@ void ViewPort::moveView(QPointF delta)
|
|||||||
{
|
{
|
||||||
param_matrixWorld.translate(delta.x(),delta.y());
|
param_matrixWorld.translate(delta.x(),delta.y());
|
||||||
controlImagePosition();
|
controlImagePosition();
|
||||||
|
viewport()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
//factor is -0.5 (zoom out) or 0.5 (zoom in)
|
//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)
|
void ViewPort::wheelEvent(QWheelEvent *event)
|
||||||
{
|
{
|
||||||
scaleView( -event->delta() / 240.0,event->pos());
|
scaleView( -event->delta() / 240.0,event->pos());
|
||||||
|
viewport()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewPort::mousePressEvent(QMouseEvent *event)
|
void ViewPort::mousePressEvent(QMouseEvent *event)
|
||||||
|
@ -438,7 +438,7 @@ private:
|
|||||||
void icvmouseProcessing(QPointF pt, int cv_event, int flags);
|
void icvmouseProcessing(QPointF pt, int cv_event, int flags);
|
||||||
|
|
||||||
#if defined( HAVE_QT_OPENGL )
|
#if defined( HAVE_QT_OPENGL )
|
||||||
QPointer<OpenGLWidget> myGL;
|
QPointer<QGLWidget> myGL;
|
||||||
double angle;
|
double angle;
|
||||||
double zmin;
|
double zmin;
|
||||||
double zmax;
|
double zmax;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user