@ -1216,27 +1216,27 @@ double GuiReceiver::isOpenGl(QString name)
// CvTrackbar
CvTrackbar : : CvTrackbar ( CvWindow * arg , QString name , int * value , int count , CvTrackbarCallback2 on_change , void * data )
CvTrackbar : : CvTrackbar ( CvWindow * arg , QString name , int * value , int _ count, CvTrackbarCallback2 on_change , void * data )
{
callback = NULL ;
callback2 = on_change ;
userdata = data ;
create ( arg , name , value , count ) ;
create ( arg , name , value , _ count) ;
}
CvTrackbar : : CvTrackbar ( CvWindow * arg , QString name , int * value , int count , CvTrackbarCallback on_change )
CvTrackbar : : CvTrackbar ( CvWindow * arg , QString name , int * value , int _ count, CvTrackbarCallback on_change )
{
callback = on_change ;
callback2 = NULL ;
userdata = NULL ;
create ( arg , name , value , count ) ;
create ( arg , name , value , _ count) ;
}
void CvTrackbar : : create ( CvWindow * arg , QString name , int * value , int count )
void CvTrackbar : : create ( CvWindow * arg , QString name , int * value , int _ count)
{
type = type_CvTrackbar ;
myparent = arg ;
@ -1247,7 +1247,7 @@ void CvTrackbar::create(CvWindow* arg, QString name, int* value, int count)
slider = new QSlider ( Qt : : Horizontal ) ;
slider - > setFocusPolicy ( Qt : : StrongFocus ) ;
slider - > setMinimum ( 0 ) ;
slider - > setMaximum ( count ) ;
slider - > setMaximum ( _ count) ;
slider - > setPageStep ( 5 ) ;
slider - > setValue ( * value ) ;
slider - > setTickPosition ( QSlider : : TicksBelow ) ;
@ -1473,7 +1473,7 @@ void CvRadioButton::callCallBack(bool checked)
//here CvWinProperties class
CvWinProperties : : CvWinProperties ( QString name_paraWindow , QObject * parent )
CvWinProperties : : CvWinProperties ( QString name_paraWindow , QObject * /*parent*/ )
{
//setParent(parent);
type = type_CvWinProperties ;
@ -1502,7 +1502,7 @@ void CvWinProperties::closeEvent(QCloseEvent* e)
}
void CvWinProperties : : showEvent ( QShowEvent * eve nt )
void CvWinProperties : : showEvent ( QShowEvent * evnt )
{
//why -1,-1 ?: do this trick because the first time the code is run,
//no value pos was saved so we let Qt move the window in the middle of its parent (event ignored).
@ -1514,20 +1514,20 @@ void CvWinProperties::showEvent(QShowEvent* event)
if ( mypos . x ( ) > = 0 )
{
move ( mypos ) ;
eve nt - > accept ( ) ;
evnt - > accept ( ) ;
}
else
{
eve nt - > ignore ( ) ;
evnt - > ignore ( ) ;
}
}
void CvWinProperties : : hideEvent ( QHideEvent * eve nt )
void CvWinProperties : : hideEvent ( QHideEvent * evnt )
{
QSettings settings ( " OpenCV2 " , windowTitle ( ) ) ;
settings . setValue ( " pos " , pos ( ) ) ; //there is an offset of 6 pixels (so the window's position is wrong -- why ?)
eve nt - > accept ( ) ;
evnt - > accept ( ) ;
}
@ -1651,8 +1651,8 @@ void CvWindow::readSettings()
//organisation and application's name
QSettings settings ( " OpenCV2 " , QFileInfo ( QApplication : : applicationFilePath ( ) ) . fileName ( ) ) ;
QPoint pos = settings . value ( " pos " , QPoint ( 200 , 200 ) ) . toPoint ( ) ;
QSize size = settings . value ( " size " , QSize ( 400 , 400 ) ) . toSize ( ) ;
QPoint _ pos = settings . value ( " pos " , QPoint ( 200 , 200 ) ) . toPoint ( ) ;
QSize _ size = settings . value ( " size " , QSize ( 400 , 400 ) ) . toSize ( ) ;
param_flags = settings . value ( " mode_resize " , param_flags ) . toInt ( ) ;
param_gui_mode = settings . value ( " mode_gui " , param_gui_mode ) . toInt ( ) ;
@ -1664,8 +1664,8 @@ void CvWindow::readSettings()
//trackbar here
icvLoadTrackbars ( & settings ) ;
resize ( size ) ;
move ( pos ) ;
resize ( _ size) ;
move ( _ pos) ;
if ( global_control_panel )
{
@ -1852,10 +1852,10 @@ bool CvWindow::isOpenGl()
}
void CvWindow : : setViewportSize ( QSize size )
void CvWindow : : setViewportSize ( QSize _ size)
{
myView - > getWidget ( ) - > resize ( size ) ;
myView - > setSize ( size ) ;
myView - > getWidget ( ) - > resize ( _ size) ;
myView - > setSize ( _ size) ;
}
@ -2059,29 +2059,29 @@ void CvWindow::displayPropertiesWin()
//Need more test here !
void CvWindow : : keyPressEvent ( QKeyEvent * eve nt )
void CvWindow : : keyPressEvent ( QKeyEvent * evnt )
{
//see http://doc.trolltech.com/4.6/qt.html#Key-enum
int key = eve nt - > key ( ) ;
int key = evnt - > key ( ) ;
Qt : : Key qtkey = static_cast < Qt : : Key > ( key ) ;
char asciiCode = QTest : : keyToAscii ( qtkey ) ;
if ( asciiCode ! = 0 )
key = static_cast < int > ( asciiCode ) ;
else
key = eve nt - > nativeVirtualKey ( ) ; //same codes as returned by GTK-based backend
key = evnt - > nativeVirtualKey ( ) ; //same codes as returned by GTK-based backend
//control plus (Z, +, -, up, down, left, right) are used for zoom/panning functions
if ( eve nt - > modifiers ( ) ! = Qt : : ControlModifier )
if ( evnt - > modifiers ( ) ! = Qt : : ControlModifier )
{
mutexKey . lock ( ) ;
last_key = key ;
mutexKey . unlock ( ) ;
key_pressed . wakeAll ( ) ;
//eve nt->accept();
//evnt->accept();
}
QWidget : : keyPressEvent ( eve nt ) ;
QWidget : : keyPressEvent ( evnt ) ;
}
@ -2089,11 +2089,11 @@ void CvWindow::icvLoadControlPanel()
{
QSettings settings ( " OpenCV2 " , QFileInfo ( QApplication : : applicationFilePath ( ) ) . fileName ( ) + " control panel " ) ;
int size = settings . beginReadArray ( " bars " ) ;
int b size = settings . beginReadArray ( " bars " ) ;
if ( size = = global_control_panel - > myLayout - > layout ( ) - > count ( ) )
if ( b size = = global_control_panel - > myLayout - > layout ( ) - > count ( ) )
{
for ( int i = 0 ; i < size ; + + i )
for ( int i = 0 ; i < b size; + + i )
{
CvBar * t = ( CvBar * ) global_control_panel - > myLayout - > layout ( ) - > itemAt ( i ) ;
settings . setArrayIndex ( i ) ;
@ -2215,13 +2215,13 @@ void CvWindow::icvLoadButtonbar(CvButtonbar* b, QSettings* settings)
void CvWindow : : icvLoadTrackbars ( QSettings * settings )
{
int size = settings - > beginReadArray ( " trackbars " ) ;
int b size = settings - > beginReadArray ( " trackbars " ) ;
//trackbar are saved in the same order, so no need to use icvFindTrackbarByName
if ( myBarLayout - > layout ( ) - > count ( ) = = size ) //if not the same number, the window saved and loaded is not the same (nb trackbar not equal)
if ( myBarLayout - > layout ( ) - > count ( ) = = b size) //if not the same number, the window saved and loaded is not the same (nb trackbar not equal)
{
for ( int i = 0 ; i < size ; + + i )
for ( int i = 0 ; i < b size; + + i )
{
settings - > setArrayIndex ( i ) ;
@ -2544,7 +2544,7 @@ void DefaultViewPort::saveView()
}
void DefaultViewPort : : contextMenuEvent ( QContextMenuEvent * eve nt )
void DefaultViewPort : : contextMenuEvent ( QContextMenuEvent * evnt )
{
if ( centralWidget - > vect_QActions . size ( ) > 0 )
{
@ -2553,12 +2553,12 @@ void DefaultViewPort::contextMenuEvent(QContextMenuEvent* event)
foreach ( QAction * a , centralWidget - > vect_QActions )
menu . addAction ( a ) ;
menu . exec ( eve nt - > globalPos ( ) ) ;
menu . exec ( evnt - > globalPos ( ) ) ;
}
}
void DefaultViewPort : : resizeEvent ( QResizeEvent * eve nt )
void DefaultViewPort : : resizeEvent ( QResizeEvent * evnt )
{
controlImagePosition ( ) ;
@ -2569,7 +2569,7 @@ void DefaultViewPort::resizeEvent(QResizeEvent* event)
if ( param_keepRatio = = CV_WINDOW_KEEPRATIO ) //to keep the same aspect ratio
{
QSize newSize = QSize ( image2Draw_mat - > cols , image2Draw_mat - > rows ) ;
newSize . scale ( eve nt - > size ( ) , Qt : : KeepAspectRatio ) ;
newSize . scale ( evnt - > size ( ) , Qt : : KeepAspectRatio ) ;
//imageWidth/imageHeight = newWidth/newHeight +/- epsilon
//ratioX = ratioY +/- epsilon
@ -2580,7 +2580,7 @@ void DefaultViewPort::resizeEvent(QResizeEvent* event)
//move to the middle
//newSize get the delta offset to place the picture in the middle of its parent
newSize = ( eve nt - > size ( ) - newSize ) / 2 ;
newSize = ( evnt - > size ( ) - newSize ) / 2 ;
//if the toolbar is displayed, avoid drawing myview on top of it
if ( centralWidget - > myToolBar )
@ -2591,78 +2591,78 @@ void DefaultViewPort::resizeEvent(QResizeEvent* event)
}
}
return QGraphicsView : : resizeEvent ( eve nt ) ;
return QGraphicsView : : resizeEvent ( evnt ) ;
}
void DefaultViewPort : : wheelEvent ( QWheelEvent * eve nt )
void DefaultViewPort : : wheelEvent ( QWheelEvent * evnt )
{
scaleView ( eve nt - > delta ( ) / 240.0 , eve nt - > pos ( ) ) ;
scaleView ( evnt - > delta ( ) / 240.0 , evnt - > pos ( ) ) ;
viewport ( ) - > update ( ) ;
}
void DefaultViewPort : : mousePressEvent ( QMouseEvent * eve nt )
void DefaultViewPort : : mousePressEvent ( QMouseEvent * evnt )
{
int cv_event = - 1 , flags = 0 ;
QPoint pt = eve nt - > pos ( ) ;
QPoint pt = evnt - > pos ( ) ;
//icvmouseHandler: pass parameters for cv_event, flags
icvmouseHandler ( eve nt , mouse_down , cv_event , flags ) ;
icvmouseHandler ( evnt , mouse_down , cv_event , flags ) ;
icvmouseProcessing ( QPointF ( pt ) , cv_event , flags ) ;
if ( param_matrixWorld . m11 ( ) > 1 )
{
setCursor ( Qt : : ClosedHandCursor ) ;
positionGrabbing = eve nt - > pos ( ) ;
positionGrabbing = evnt - > pos ( ) ;
}
QWidget : : mousePressEvent ( eve nt ) ;
QWidget : : mousePressEvent ( evnt ) ;
}
void DefaultViewPort : : mouseReleaseEvent ( QMouseEvent * eve nt )
void DefaultViewPort : : mouseReleaseEvent ( QMouseEvent * evnt )
{
int cv_event = - 1 , flags = 0 ;
QPoint pt = eve nt - > pos ( ) ;
QPoint pt = evnt - > pos ( ) ;
//icvmouseHandler: pass parameters for cv_event, flags
icvmouseHandler ( eve nt , mouse_up , cv_event , flags ) ;
icvmouseHandler ( evnt , mouse_up , cv_event , flags ) ;
icvmouseProcessing ( QPointF ( pt ) , cv_event , flags ) ;
if ( param_matrixWorld . m11 ( ) > 1 )
setCursor ( Qt : : OpenHandCursor ) ;
QWidget : : mouseReleaseEvent ( eve nt ) ;
QWidget : : mouseReleaseEvent ( evnt ) ;
}
void DefaultViewPort : : mouseDoubleClickEvent ( QMouseEvent * eve nt )
void DefaultViewPort : : mouseDoubleClickEvent ( QMouseEvent * evnt )
{
int cv_event = - 1 , flags = 0 ;
QPoint pt = eve nt - > pos ( ) ;
QPoint pt = evnt - > pos ( ) ;
//icvmouseHandler: pass parameters for cv_event, flags
icvmouseHandler ( eve nt , mouse_dbclick , cv_event , flags ) ;
icvmouseHandler ( evnt , mouse_dbclick , cv_event , flags ) ;
icvmouseProcessing ( QPointF ( pt ) , cv_event , flags ) ;
QWidget : : mouseDoubleClickEvent ( eve nt ) ;
QWidget : : mouseDoubleClickEvent ( evnt ) ;
}
void DefaultViewPort : : mouseMoveEvent ( QMouseEvent * eve nt )
void DefaultViewPort : : mouseMoveEvent ( QMouseEvent * evnt )
{
int cv_event = CV_EVENT_MOUSEMOVE , flags = 0 ;
QPoint pt = eve nt - > pos ( ) ;
QPoint pt = evnt - > pos ( ) ;
//icvmouseHandler: pass parameters for cv_event, flags
icvmouseHandler ( eve nt , mouse_move , cv_event , flags ) ;
icvmouseHandler ( evnt , mouse_move , cv_event , flags ) ;
icvmouseProcessing ( QPointF ( pt ) , cv_event , flags ) ;
if ( param_matrixWorld . m11 ( ) > 1 & & eve nt - > buttons ( ) = = Qt : : LeftButton )
if ( param_matrixWorld . m11 ( ) > 1 & & evnt - > buttons ( ) = = Qt : : LeftButton )
{
QPointF dxy = ( pt - positionGrabbing ) / param_matrixWorld . m11 ( ) ;
positionGrabbing = eve nt - > pos ( ) ;
positionGrabbing = evnt - > pos ( ) ;
moveView ( dxy ) ;
}
@ -2671,11 +2671,11 @@ void DefaultViewPort::mouseMoveEvent(QMouseEvent* event)
if ( centralWidget - > myStatusBar )
viewport ( ) - > update ( ) ;
QWidget : : mouseMoveEvent ( eve nt ) ;
QWidget : : mouseMoveEvent ( evnt ) ;
}
void DefaultViewPort : : paintEvent ( QPaintEvent * eve nt )
void DefaultViewPort : : paintEvent ( QPaintEvent * evnt )
{
QPainter myPainter ( viewport ( ) ) ;
myPainter . setWorldTransform ( param_matrixWorld ) ;
@ -2707,7 +2707,7 @@ void DefaultViewPort::paintEvent(QPaintEvent* event)
if ( centralWidget - > myStatusBar )
drawStatusBar ( ) ;
QGraphicsView : : paintEvent ( eve nt ) ;
QGraphicsView : : paintEvent ( evnt ) ;
}
@ -2811,10 +2811,10 @@ void DefaultViewPort::scaleView(qreal factor,QPointF center)
//up, down, dclick, move
void DefaultViewPort : : icvmouseHandler ( QMouseEvent * eve nt , type_mouse_event category , int & cv_event , int & flags )
void DefaultViewPort : : icvmouseHandler ( QMouseEvent * evnt , type_mouse_event category , int & cv_event , int & flags )
{
Qt : : KeyboardModifiers modifiers = eve nt - > modifiers ( ) ;
Qt : : MouseButtons buttons = eve nt - > buttons ( ) ;
Qt : : KeyboardModifiers modifiers = evnt - > modifiers ( ) ;
Qt : : MouseButtons buttons = evnt - > buttons ( ) ;
flags = 0 ;
if ( modifiers & Qt : : ShiftModifier )
@ -2832,7 +2832,7 @@ void DefaultViewPort::icvmouseHandler(QMouseEvent *event, type_mouse_event categ
flags | = CV_EVENT_FLAG_MBUTTON ;
cv_event = CV_EVENT_MOUSEMOVE ;
switch ( eve nt - > button ( ) )
switch ( evnt - > button ( ) )
{
case Qt : : LeftButton :
cv_event = tableMouseButtons [ category ] [ 0 ] ;
@ -2933,12 +2933,12 @@ void DefaultViewPort::drawImgRegion(QPainter *painter)
QSize view = size ( ) ;
QVarLengthArray < QLineF , 30 > linesX ;
for ( qreal x = offsetX * param_matrixWorld . m11 ( ) ; x < view . width ( ) ; x + = param_matrixWorld . m11 ( ) )
linesX . append ( QLineF ( x , 0 , x , view . height ( ) ) ) ;
for ( qreal _ x = offsetX * param_matrixWorld . m11 ( ) ; _ x < view . width ( ) ; _ x + = param_matrixWorld . m11 ( ) )
linesX . append ( QLineF ( _ x, 0 , _ x, view . height ( ) ) ) ;
QVarLengthArray < QLineF , 30 > linesY ;
for ( qreal y = offsetY * param_matrixWorld . m11 ( ) ; y < view . height ( ) ; y + = param_matrixWorld . m11 ( ) )
linesY . append ( QLineF ( 0 , y , view . width ( ) , y ) ) ;
for ( qreal _ y = offsetY * param_matrixWorld . m11 ( ) ; _ y < view . height ( ) ; _ y + = param_matrixWorld . m11 ( ) )
linesY . append ( QLineF ( 0 , _ y, view . width ( ) , _ y) ) ;
QFont f = painter - > font ( ) ;
@ -3043,17 +3043,17 @@ void DefaultViewPort::drawInstructions(QPainter *painter)
QFontMetrics metrics = QFontMetrics ( font ( ) ) ;
int border = qMax ( 4 , metrics . leading ( ) ) ;
QRect rect = metrics . boundingRect ( 0 , 0 , width ( ) - 2 * border , int ( height ( ) * 0.125 ) ,
QRect q rect = metrics . boundingRect ( 0 , 0 , width ( ) - 2 * border , int ( height ( ) * 0.125 ) ,
Qt : : AlignCenter | Qt : : TextWordWrap , infoText ) ;
painter - > setRenderHint ( QPainter : : TextAntialiasing ) ;
painter - > fillRect ( QRect ( 0 , 0 , width ( ) , rect . height ( ) + 2 * border ) ,
painter - > fillRect ( QRect ( 0 , 0 , width ( ) , q rect. height ( ) + 2 * border ) ,
QColor ( 0 , 0 , 0 , 127 ) ) ;
painter - > setPen ( Qt : : white ) ;
painter - > fillRect ( QRect ( 0 , 0 , width ( ) , rect . height ( ) + 2 * border ) ,
painter - > fillRect ( QRect ( 0 , 0 , width ( ) , q rect. height ( ) + 2 * border ) ,
QColor ( 0 , 0 , 0 , 127 ) ) ;
painter - > drawText ( ( width ( ) - rect . width ( ) ) / 2 , border ,
rect . width ( ) , rect . height ( ) ,
painter - > drawText ( ( width ( ) - q rect. width ( ) ) / 2 , border ,
q rect. width ( ) , q rect. height ( ) ,
Qt : : AlignCenter | Qt : : TextWordWrap , infoText ) ;
}
@ -3068,7 +3068,7 @@ void DefaultViewPort::setSize(QSize size_)
# ifdef HAVE_QT_OPENGL
OpenGlViewPort : : OpenGlViewPort ( QWidget * parent ) : QGLWidget ( parent ) , size ( - 1 , - 1 )
OpenGlViewPort : : OpenGlViewPort ( QWidget * _ parent) : QGLWidget ( _ parent) , size ( - 1 , - 1 )
{
mouseCallback = 0 ;
mouseData = 0 ;
@ -3381,26 +3381,26 @@ void OpenGlViewPort::initializeGL()
glHint ( GL_PERSPECTIVE_CORRECTION_HINT , GL_NICEST ) ;
# ifdef Q_WS_WIN
std : : auto_ptr < GlFuncTab_QT > glFuncTab ( new GlFuncTab_QT ( getDC ( ) ) ) ;
std : : auto_ptr < GlFuncTab_QT > q glFuncTab( new GlFuncTab_QT ( getDC ( ) ) ) ;
# else
std : : auto_ptr < GlFuncTab_QT > glFuncTab ( new GlFuncTab_QT ) ;
std : : auto_ptr < GlFuncTab_QT > q glFuncTab( new GlFuncTab_QT ) ;
# endif
// Load extensions
glFuncTab - > glGenBuffersExt = ( PFNGLGENBUFFERSPROC ) context ( ) - > getProcAddress ( " glGenBuffers " ) ;
glFuncTab - > glDeleteBuffersExt = ( PFNGLDELETEBUFFERSPROC ) context ( ) - > getProcAddress ( " glDeleteBuffers " ) ;
glFuncTab - > glBufferDataExt = ( PFNGLBUFFERDATAPROC ) context ( ) - > getProcAddress ( " glBufferData " ) ;
glFuncTab - > glBufferSubDataExt = ( PFNGLBUFFERSUBDATAPROC ) context ( ) - > getProcAddress ( " glBufferSubData " ) ;
glFuncTab - > glBindBufferExt = ( PFNGLBINDBUFFERPROC ) context ( ) - > getProcAddress ( " glBindBuffer " ) ;
glFuncTab - > glMapBufferExt = ( PFNGLMAPBUFFERPROC ) context ( ) - > getProcAddress ( " glMapBuffer " ) ;
glFuncTab - > glUnmapBufferExt = ( PFNGLUNMAPBUFFERPROC ) context ( ) - > getProcAddress ( " glUnmapBuffer " ) ;
q glFuncTab- > glGenBuffersExt = ( PFNGLGENBUFFERSPROC ) context ( ) - > getProcAddress ( " glGenBuffers " ) ;
q glFuncTab- > glDeleteBuffersExt = ( PFNGLDELETEBUFFERSPROC ) context ( ) - > getProcAddress ( " glDeleteBuffers " ) ;
q glFuncTab- > glBufferDataExt = ( PFNGLBUFFERDATAPROC ) context ( ) - > getProcAddress ( " glBufferData " ) ;
q glFuncTab- > glBufferSubDataExt = ( PFNGLBUFFERSUBDATAPROC ) context ( ) - > getProcAddress ( " glBufferSubData " ) ;
q glFuncTab- > glBindBufferExt = ( PFNGLBINDBUFFERPROC ) context ( ) - > getProcAddress ( " glBindBuffer " ) ;
q glFuncTab- > glMapBufferExt = ( PFNGLMAPBUFFERPROC ) context ( ) - > getProcAddress ( " glMapBuffer " ) ;
q glFuncTab- > glUnmapBufferExt = ( PFNGLUNMAPBUFFERPROC ) context ( ) - > getProcAddress ( " glUnmapBuffer " ) ;
glFuncTab - > initialized = true ;
q glFuncTab- > initialized = true ;
this - > glFuncTab = glFuncTab . release ( ) ;
glFuncTab = q glFuncTab. release ( ) ;
icvSetOpenGlFuncTab ( this - > glFuncTab ) ;
icvSetOpenGlFuncTab ( glFuncTab ) ;
}
void OpenGlViewPort : : resizeGL ( int w , int h )
@ -3420,58 +3420,58 @@ void OpenGlViewPort::paintGL()
CV_CheckGlError ( ) ;
}
void OpenGlViewPort : : mousePressEvent ( QMouseEvent * eve nt )
void OpenGlViewPort : : mousePressEvent ( QMouseEvent * evnt )
{
int cv_event = - 1 , flags = 0 ;
QPoint pt = eve nt - > pos ( ) ;
QPoint pt = evnt - > pos ( ) ;
icvmouseHandler ( eve nt , mouse_down , cv_event , flags ) ;
icvmouseHandler ( evnt , mouse_down , cv_event , flags ) ;
icvmouseProcessing ( QPointF ( pt ) , cv_event , flags ) ;
QGLWidget : : mousePressEvent ( eve nt ) ;
QGLWidget : : mousePressEvent ( evnt ) ;
}
void OpenGlViewPort : : mouseReleaseEvent ( QMouseEvent * eve nt )
void OpenGlViewPort : : mouseReleaseEvent ( QMouseEvent * evnt )
{
int cv_event = - 1 , flags = 0 ;
QPoint pt = eve nt - > pos ( ) ;
QPoint pt = evnt - > pos ( ) ;
icvmouseHandler ( eve nt , mouse_up , cv_event , flags ) ;
icvmouseHandler ( evnt , mouse_up , cv_event , flags ) ;
icvmouseProcessing ( QPointF ( pt ) , cv_event , flags ) ;
QGLWidget : : mouseReleaseEvent ( eve nt ) ;
QGLWidget : : mouseReleaseEvent ( evnt ) ;
}
void OpenGlViewPort : : mouseDoubleClickEvent ( QMouseEvent * eve nt )
void OpenGlViewPort : : mouseDoubleClickEvent ( QMouseEvent * evnt )
{
int cv_event = - 1 , flags = 0 ;
QPoint pt = eve nt - > pos ( ) ;
QPoint pt = evnt - > pos ( ) ;
icvmouseHandler ( eve nt , mouse_dbclick , cv_event , flags ) ;
icvmouseHandler ( evnt , mouse_dbclick , cv_event , flags ) ;
icvmouseProcessing ( QPointF ( pt ) , cv_event , flags ) ;
QGLWidget : : mouseDoubleClickEvent ( eve nt ) ;
QGLWidget : : mouseDoubleClickEvent ( evnt ) ;
}
void OpenGlViewPort : : mouseMoveEvent ( QMouseEvent * eve nt )
void OpenGlViewPort : : mouseMoveEvent ( QMouseEvent * evnt )
{
int cv_event = CV_EVENT_MOUSEMOVE , flags = 0 ;
QPoint pt = eve nt - > pos ( ) ;
QPoint pt = evnt - > pos ( ) ;
//icvmouseHandler: pass parameters for cv_event, flags
icvmouseHandler ( eve nt , mouse_move , cv_event , flags ) ;
icvmouseHandler ( evnt , mouse_move , cv_event , flags ) ;
icvmouseProcessing ( QPointF ( pt ) , cv_event , flags ) ;
QGLWidget : : mouseMoveEvent ( eve nt ) ;
QGLWidget : : mouseMoveEvent ( evnt ) ;
}
void OpenGlViewPort : : icvmouseHandler ( QMouseEvent * eve nt , type_mouse_event category , int & cv_event , int & flags )
void OpenGlViewPort : : icvmouseHandler ( QMouseEvent * evnt , type_mouse_event category , int & cv_event , int & flags )
{
Qt : : KeyboardModifiers modifiers = eve nt - > modifiers ( ) ;
Qt : : MouseButtons buttons = eve nt - > buttons ( ) ;
Qt : : KeyboardModifiers modifiers = evnt - > modifiers ( ) ;
Qt : : MouseButtons buttons = evnt - > buttons ( ) ;
flags = 0 ;
if ( modifiers & Qt : : ShiftModifier )
@ -3489,7 +3489,7 @@ void OpenGlViewPort::icvmouseHandler(QMouseEvent* event, type_mouse_event catego
flags | = CV_EVENT_FLAG_MBUTTON ;
cv_event = CV_EVENT_MOUSEMOVE ;
switch ( eve nt - > button ( ) )
switch ( evnt - > button ( ) )
{
case Qt : : LeftButton :
cv_event = tableMouseButtons [ category ] [ 0 ] ;