From 41bc1c2f4f4e91e12031f115ad022edd34e7196b Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 13 Feb 2013 13:50:23 +0000 Subject: [PATCH] Issue 32118 (Acheron) - added a flag that controls whether the custom Resizer is used or not --- src/Qtx/QtxMainWindow.cxx | 36 +++++++++++++++++++++++++++++++++--- src/Qtx/QtxMainWindow.h | 5 +++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/Qtx/QtxMainWindow.cxx b/src/Qtx/QtxMainWindow.cxx index dad786f4a..7b6ffff04 100644 --- a/src/Qtx/QtxMainWindow.cxx +++ b/src/Qtx/QtxMainWindow.cxx @@ -236,7 +236,8 @@ QtxMainWindow::QtxMainWindow( QWidget* parent, Qt::WindowFlags f ) myStatusBar( 0 ), myOpaque( true ), myResizer( 0 ), - myMouseMove( 0 ) + myMouseMove( 0 ), + myResizerEnabled( true ) { } @@ -355,6 +356,25 @@ void QtxMainWindow::setOpaqueResize( bool on ) myOpaque = on; } +/*! + \brief Returns whether a resizer is enabled or not + \return boolean flag + */ +bool QtxMainWindow::isResizerEnabled() const +{ + return myResizerEnabled; +} + +/*! + \brief Sets a flag that controls whether a resizer is enabled or not + \param on boolean flag + */ +void QtxMainWindow::setResizerEnabled( bool on ) +{ + myResizerEnabled = on; +} + + /*! \brief Dump main window geometry to the string. \return string represenation of the window geometry @@ -564,7 +584,10 @@ bool QtxMainWindow::event( QEvent* e ) QMouseEvent* me = static_cast( e ); myResizer->setFinalEvent( new QMouseEvent( me->type(), me->pos(), me->globalPos(), me->button(), me->buttons(), me->modifiers() ) ); - myResizer = 0; + if(myResizer) { + delete myResizer; + myResizer = 0; + } return true; } @@ -595,7 +618,14 @@ bool QtxMainWindow::event( QEvent* e ) } if ( status ) { QMouseEvent* me = static_cast( e ); - myResizer = new Resizer( me->globalPos(), o, this ); + if(myResizerEnabled) + myResizer = new Resizer( me->globalPos(), o, this ); + else { + if(myResizer) { + delete myResizer; + myResizer = 0; + } + } } } } diff --git a/src/Qtx/QtxMainWindow.h b/src/Qtx/QtxMainWindow.h index d574cf024..8770856f9 100644 --- a/src/Qtx/QtxMainWindow.h +++ b/src/Qtx/QtxMainWindow.h @@ -42,6 +42,9 @@ public: bool isOpaqueResize() const; void setOpaqueResize( bool ); + bool isResizerEnabled() const; + void setResizerEnabled( bool ); + bool isDockableMenuBar() const; void setDockableMenuBar( const bool ); @@ -67,6 +70,8 @@ private: bool myOpaque; Resizer* myResizer; QMouseEvent* myMouseMove; + + bool myResizerEnabled; }; #endif // QTXMAINWINDOW_H -- 2.39.2