From: vsr Date: Fri, 11 May 2007 08:49:49 +0000 (+0000) Subject: Porting to Qt4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1d1f001c3a4cf70583081fdb1480a4a8e535b0f5;p=modules%2Fgui.git Porting to Qt4 --- diff --git a/src/Qtx/QtxActionMgr.h b/src/Qtx/QtxActionMgr.h index a1e46ddf1..eef1607ca 100644 --- a/src/Qtx/QtxActionMgr.h +++ b/src/Qtx/QtxActionMgr.h @@ -101,7 +101,7 @@ private: QTX_EXPORT typedef QMap ItemAttributes; //!< attributes map -class QtxActionMgr::Creator +class QTX_EXPORT QtxActionMgr::Creator { public: Creator( QtxActionMgr::Reader* ); @@ -109,11 +109,11 @@ public: Reader* reader() const; - virtual int append( const QString&, const bool, - const ItemAttributes&, const int ) = 0; - virtual void connect( QAction* ) const; + virtual int append( const QString&, const bool, + const ItemAttributes&, const int ) = 0; + virtual void connect( QAction* ) const; - virtual bool loadPixmap( const QString&, QPixmap& ) const; + virtual bool loadPixmap( const QString&, QPixmap& ) const; protected: static int intValue( const ItemAttributes&, const QString&, const int ); @@ -123,33 +123,33 @@ private: QtxActionMgr::Reader* myReader; //!< actions reader }; -class QtxActionMgr::Reader +class QTX_EXPORT QtxActionMgr::Reader { public: - QTX_EXPORT Reader(); - QTX_EXPORT virtual ~Reader(); + Reader(); + virtual ~Reader(); - QTX_EXPORT QStringList options() const; - QTX_EXPORT QString option( const QString&, const QString& = QString::null ) const; - QTX_EXPORT void setOption( const QString&, const QString& ); + QStringList options() const; + QString option( const QString&, const QString& = QString::null ) const; + void setOption( const QString&, const QString& ); - QTX_EXPORT virtual bool read( const QString&, Creator& ) const = 0; + virtual bool read( const QString&, Creator& ) const = 0; private: QMap< QString, QString > myOptions; //!< options map }; -class QtxActionMgr::XMLReader : public Reader +class QTX_EXPORT QtxActionMgr::XMLReader : public Reader { public: - QTX_EXPORT XMLReader( const QString&, const QString&, const QString& ); - QTX_EXPORT virtual ~XMLReader(); + XMLReader( const QString&, const QString&, const QString& ); + virtual ~XMLReader(); - QTX_EXPORT virtual bool read( const QString&, Creator& ) const; + virtual bool read( const QString&, Creator& ) const; protected: - QTX_EXPORT virtual void read( const QDomNode&, const int, Creator& ) const; - QTX_EXPORT virtual bool isNodeSimilar( const QDomNode&, const QString& ) const; + virtual void read( const QDomNode&, const int, Creator& ) const; + virtual bool isNodeSimilar( const QDomNode&, const QString& ) const; }; diff --git a/src/Qtx/QtxDirListEditor.h b/src/Qtx/QtxDirListEditor.h index 38d62dead..2edbfc7e6 100644 --- a/src/Qtx/QtxDirListEditor.h +++ b/src/Qtx/QtxDirListEditor.h @@ -34,7 +34,8 @@ /*! * \brief The GUI implementation of the directory list */ -class QTX_EXPORT QtxDirListEditor : public QWidget { +class QTX_EXPORT QtxDirListEditor : public QWidget +{ Q_OBJECT diff --git a/src/Qtx/QtxMainWindow.cxx b/src/Qtx/QtxMainWindow.cxx index 99f602bbb..741a2ef25 100644 --- a/src/Qtx/QtxMainWindow.cxx +++ b/src/Qtx/QtxMainWindow.cxx @@ -24,14 +24,18 @@ #include "QtxToolBar.h" #include "QtxResourceMgr.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /*! - Class: QtxMainWindow::Filter [Internal] - Descr: Internal object with event filter for QtxMainWindow. + \class QtxMainWindow::Filter + \internal + \brief Internal object used to filter child removal events for + specified widget from parent widget. */ class QtxMainWindow::Filter : public QObject @@ -43,30 +47,39 @@ public: virtual bool eventFilter( QObject*, QEvent* ); private: - QMainWindow* myMain; - QWidget* myWidget; + QMainWindow* myMain; //!< parent main window + QWidget* myWidget; //!< widget being watched }; /*! - Constructor + \brief Constructor. + \param wid widget to be watched + \param mw parent main window + \param parent parent object (in terms of QObject) */ QtxMainWindow::Filter::Filter( QWidget* wid, QtxMainWindow* mw, QObject* parent ) : QObject( parent ), -myMain( mw ), -myWidget( wid ) + myMain( mw ), + myWidget( wid ) { - myMain->installEventFilter( this ); + QApplication::instance()->installEventFilter( this ); }; /*! - Destructor + \brief Destructor. */ QtxMainWindow::Filter::~Filter() { } /*! - Custom event filter + \brief Event filter. + + Watches for the specified widget and prevents its removal from the + parent main window. + + \param o recevier object + \param e event */ bool QtxMainWindow::Filter::eventFilter( QObject* o, QEvent* e ) { @@ -77,21 +90,27 @@ bool QtxMainWindow::Filter::eventFilter( QObject* o, QEvent* e ) return QObject::eventFilter( o, e ); } + +/*! + \class QtxMainWindow + \brief Enhanced main window which supports dockable menubar and status bar + plus geometry saving/restoring. +*/ + /*! - Class: QtxMainWindow [Public] - Descr: Main window with support of dockable menubar/status bar - and geometry store/retrieve. + \brief Constructor. + \param parent parent widget + \param f widget flags (Qt::WindowFlags) */ -QtxMainWindow::QtxMainWindow( QWidget* parent, const char* name, WFlags f ) -: QMainWindow( parent, name, f ), -myMode( -1 ), -myMenuBar( NULL ), -myStatusBar( NULL ) +QtxMainWindow::QtxMainWindow( QWidget* parent, Qt::WindowFlags f ) +: QMainWindow( parent, f ), + myMenuBar( 0 ), + myStatusBar( 0 ) { } /*! - Destructor + \brief Destructor. */ QtxMainWindow::~QtxMainWindow() { @@ -100,16 +119,18 @@ QtxMainWindow::~QtxMainWindow() } /*! - \return true if menu bar exists + \brief Check if the menu bar is dockable. + \return \c true if dockable menu bar exists */ bool QtxMainWindow::isDockableMenuBar() const { - return myMenuBar; + return myMenuBar != 0; } /*! - Creates or deletes menu bar - \param on - if it is true, then to create, otherwise - to delete + \brief Set menu bar dockable/undockable. + \param on if \c true, make menu bar dockable, otherwise + make menu bar undockable */ void QtxMainWindow::setDockableMenuBar( const bool on ) { @@ -122,38 +143,31 @@ void QtxMainWindow::setDockableMenuBar( const bool on ) if ( on && !myMenuBar ) { - mb->setCaption( tr( "Menu bar" ) ); - QtxToolBar* dockMb = new QtxToolBar( true, this, "menu bar container" ); - myMenuBar = dockMb; + myMenuBar = new QtxToolBar( true, this ); new Filter( mb, this, myMenuBar ); - dockMb->setWidget( mb ); - dockMb->setNewLine( true ); - dockMb->setStretchable( true ); - dockMb->setResizeEnabled( false ); + myMenuBar->setObjectName( "menu_bar_container" ); + myMenuBar->setWindowTitle( tr( "Menu bar" ) ); + myMenuBar->addWidget( mb ); + myMenuBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea ); - moveDockWindow( dockMb, DockTop ); - setDockEnabled( dockMb, Left, false ); - setDockEnabled( dockMb, Right, false ); + addToolBarBreak( Qt::TopToolBarArea ); + addToolBar( Qt::TopToolBarArea, myMenuBar ); + addToolBarBreak( Qt::TopToolBarArea ); - setAppropriate( dockMb, false ); - - connect( dockMb, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) ); + connect( myMenuBar, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) ); } else if ( !on && myMenuBar ) { - mb->reparent( this, QPoint( 0, 0 ), mb->isVisibleTo( mb->parentWidget() ) ); + setMenuBar( mb ); disconnect( myMenuBar, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) ); delete myMenuBar; myMenuBar = 0; - QChildEvent ce( QEvent::ChildRemoved, mb ); - QApplication::sendEvent( this, &ce ); } - - setUpLayout(); } /*! - \return true if status bar exists + \brief Check if the status bar is dockable. + \return \c true if dockable status bar exists */ bool QtxMainWindow::isDockableStatusBar() const { @@ -161,8 +175,9 @@ bool QtxMainWindow::isDockableStatusBar() const } /*! - Creates or deletes status bar - \param on - if it is true, then to create, otherwise - to delete + \brief Set status bar dockable/undockable. + \param on if \c true, make status bar dockable, otherwise + make status bar undockable */ void QtxMainWindow::setDockableStatusBar( const bool on ) { @@ -175,209 +190,203 @@ void QtxMainWindow::setDockableStatusBar( const bool on ) if ( on && !myStatusBar ) { - sb->setCaption( tr( "Status bar" ) ); - QtxToolBar* dockSb = new QtxToolBar( true, this, "status bar container" ); - myStatusBar = dockSb; - new Filter( sb, this, myStatusBar ); - dockSb->setWidget( sb ); - dockSb->setNewLine( true ); - dockSb->setStretchable( true ); - dockSb->setResizeEnabled( false ); sb->setMinimumWidth( 250 ); - sb->setSizeGripEnabled( false ); + myStatusBar = new QtxToolBar( true, this ); + new Filter( sb, this, myStatusBar ); + myStatusBar->setObjectName( "status_bar_container" ); + myStatusBar->setWindowTitle( tr( "Status bar" ) ); + myStatusBar->addWidget( sb ); + myStatusBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea ); - moveDockWindow( dockSb, DockBottom ); - setDockEnabled( dockSb, Left, false ); - setDockEnabled( dockSb, Right, false ); - - setAppropriate( dockSb, false ); + addToolBar( Qt::BottomToolBarArea, myStatusBar ); - connect( dockSb, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) ); + connect( myStatusBar, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) ); } else if ( !on && myStatusBar ) { - sb->reparent( this, QPoint( 0, 0 ), sb->isVisibleTo( sb->parentWidget() ) ); + setStatusBar( sb ); disconnect( myStatusBar, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) ); delete myStatusBar; myStatusBar = 0; - QChildEvent ce( QEvent::ChildRemoved, sb ); - QApplication::sendEvent( this, &ce ); sb->setSizeGripEnabled( true ); } - - setUpLayout(); } /*! - Retrieve the geometry information from the specified resource manager section. - \param resMgr - instance of ersource manager - \param section - section name + \brief Dump main window geometry to the string. + \return string represenation of the window geometry */ -void QtxMainWindow::loadGeometry( QtxResourceMgr* resMgr, const QString& section ) +QString QtxMainWindow::storeGeometry() const { - QString sec = section.stripWhiteSpace(); - if ( !resMgr || sec.isEmpty() ) - return; - - int winState = -1; - if ( !resMgr->value( sec, "state", winState ) ) - { - QString stateStr; - if ( resMgr->value( sec, "state", stateStr ) ) - winState = windowState( stateStr ); - } - - int win_w = resMgr->integerValue( sec, "width", width() ); - int win_h = resMgr->integerValue( sec, "height", height() ); - - int winPosX = windowPosition( resMgr->stringValue( sec, QString( "pos_x" ), QString::null ) ); - int winPosY = windowPosition( resMgr->stringValue( sec, QString( "pos_y" ), QString::null ) ); - - QWidget* desk = QApplication::desktop(); - - int win_x = 0; - if ( winPosX == WP_Absolute ) - win_x = resMgr->integerValue( sec, "pos_x", x() ); - else if ( desk ) - win_x = relativeCoordinate( winPosX, desk->width(), win_w ); - - int win_y = 0; - if ( winPosX == WP_Absolute ) - win_y = resMgr->integerValue( sec, "pos_y", y() ); - else if ( desk ) - win_y = relativeCoordinate( winPosY, desk->height(), win_h ); - - bool vis = isVisibleTo( parentWidget() ); - - resize( win_w, win_h ); - move( win_x, win_y ); - - myMode = -1; - - if ( vis ) - QApplication::postEvent( this, new QCustomEvent( QEvent::User, (void*)winState ) ); + QRect frame = frameGeometry(); + QRect screen = QApplication::desktop()->availableGeometry( this ); + + QString x; + if ( frame.left() == screen.left() ) + x = QString( "+0" ); + else if ( frame.right() == screen.right() ) + x = QString( "-0" ); else - myMode = winState; -} - -/*! - Shows main window -*/ -void QtxMainWindow::show() -{ - if ( myMode != -1 ) - QApplication::postEvent( this, new QCustomEvent( QEvent::User, (void*)myMode ) ); + x = QString( "+%1" ).arg( frame.left() ); - myMode = -1; - - QMainWindow::show(); -} + QString y; + if ( frame.top() == screen.top() ) + y = QString( "+0" ); + else if ( frame.bottom() == screen.bottom() ) + y = QString( "-0" ); + else + y = QString( "+%1" ).arg( frame.top() ); -/*! - Handler of custom events -*/ -void QtxMainWindow::customEvent( QCustomEvent* e ) -{ - QMainWindow::customEvent( e ); + QString geom = QString( "%1x%2%3%4" ).arg( frame.width() ).arg( frame.height() ).arg( x ).arg( y ); - size_t mode = size_t(e->data()); - switch ( mode ) + QString state; + switch ( windowState() ) { - case WS_Normal: - showNormal(); + case Qt::WindowMaximized: + state = QString( "max" ); break; - case WS_Minimized: - showMinimized(); + case Qt::WindowMinimized: + state = QString( "min" ); break; - case WS_Maximized: - showMaximized(); + case Qt::WindowFullScreen: + state = QString( "full" ); break; } + + if ( !state.isEmpty() ) + geom += QString( ":" ) + state; + + return geom; } /*! - \return relative co-ordinate by two points - \param type - type of result: WP_Center (center), WP_Left (left), WP_Right (right) - \param wh - left point - \param WH - right point + \brief Restore main window geometry from the string. + \param str string represenation of the window geometry */ -int QtxMainWindow::relativeCoordinate( const int type, const int WH, const int wh ) const +void QtxMainWindow::retrieveGeometry( const QString& str ) { - int res = 0; - switch ( type ) + QString geom = str; + geom.remove( '\t' ); + geom.remove( ' ' ); + + QRect rect = geometry(); + QRect screen = QApplication::desktop()->availableGeometry( this ); + + QRegExp szRx( "(\\d+%?)\\s*x\\s*(\\d+%?)" ); + if ( szRx.indexIn( geom ) != -1 ) { - case WP_Center: - res = ( WH - wh ) / 2; - break; - case WP_Left: - res = 0; - break; - case WP_Right: - res = WH - wh; - break; + int w = -1; + bool wp = false; + int ws = geometryValue( szRx.cap( 1 ).trimmed(), w, wp ); + bool wOk = ws != 0; + if ( wOk && wp ) + w = screen.width() * qMax( qMin( w, 100 ), 0 ) / 100; + wOk = wOk && w; + + int h = -1; + bool hp = false; + int hs = geometryValue( szRx.cap( 2 ).trimmed(), h, hp ); + bool hOk = hs != 0; + if ( hOk && hp ) + h = screen.height() * qMax( qMin( h, 100 ), 0 ) / 100; + hOk = hOk && h; + + if ( wOk && hOk ) + rect.setSize( QSize( w, h ) ); } - return res; -} -/*! - Store the geometry information into the specified resource manager section. - \param resMgr - instance of ersource manager - \param section - section name -*/ -void QtxMainWindow::saveGeometry( QtxResourceMgr* resMgr, const QString& section ) const -{ - QString sec = section.stripWhiteSpace(); - if ( !resMgr || sec.isEmpty() ) - return; + QRegExp posRx( "([+|-]\\d+\%?)\\s*([+|-]\\d+\%?)" ); + if ( posRx.indexIn( geom ) != -1 ) + { + int x = -1; + bool xp = false; + int xs = geometryValue( posRx.cap( 1 ).trimmed(), x, xp ); + bool xOk = xs != 0; + if ( xOk ) + { + if ( xp ) + x = screen.width() * qMax( qMin( x, 100 ), 0 ) / 100; + x = ( xs > 0 ? x : screen.right() - x - rect.width() ) + frameGeometry().x() - geometry().x(); + } + + int y = -1; + bool yp = false; + int ys = geometryValue( posRx.cap( 2 ).trimmed(), y, yp ); + bool yOk = ys != 0; + if ( yOk ) + { + if ( yp ) + y = screen.height() * qMax( qMin( y, 100 ), 0 ) / 100; + y = ( ys > 0 ? y : screen.bottom() - y - rect.height() ) + frameGeometry().y() - geometry().y(); + } + + if ( xOk && yOk ) + rect.moveTo( x, y ); + } - resMgr->setValue( sec, "pos_x", pos().x() ); - resMgr->setValue( sec, "pos_y", pos().y() ); - resMgr->setValue( sec, "width", width() ); - resMgr->setValue( sec, "height", height() ); + Qt::WindowState state = Qt::WindowNoState; - int winState = WS_Normal; - if ( isMinimized() ) - winState = WS_Minimized; - else if ( isMaximized() ) - winState = WS_Maximized; + QRegExp stRx( ":(\\w+)" ); + if ( stRx.indexIn( geom ) != -1 ) + { + QString stStr = stRx.cap( 1 ).trimmed().toLower(); + if ( stStr.startsWith( QString( "max" ) ) ) + state = Qt::WindowMaximized; + else if ( stStr.startsWith( QString( "min" ) ) ) + state = Qt::WindowMinimized; + else if ( stStr.startsWith( QString( "full" ) ) ) + state = Qt::WindowFullScreen; + } - resMgr->setValue( sec, "state", winState ); + setGeometry( rect ); + if ( state != Qt::WindowNoState ) + setWindowState( state ); } /*! - Custom event filter + \brief Retrieve numerical value from the string. + + Numerical value in the string have the structure [+|-]\d*[%], + that is one or more digits which can start from "+" or "-" and + can end with "%" symbol. + + \param str string being converted + \param num returning value (> 0) + \param percent if string ends with "%" this parameter is equal to \c true after + returning from the function + \return -1 if value < 0, 1 if value > 0 and 0 in case of error */ -bool QtxMainWindow::eventFilter( QObject* o, QEvent* e ) +int QtxMainWindow::geometryValue( const QString& str, int& num, bool& percent ) const { - return QMainWindow::eventFilter( o, e ); -} + num = -1; + int res = 1; + QString numStr = str; + if ( numStr.startsWith( "+" ) || numStr.startsWith( "-" ) ) + { + res = numStr.startsWith( "+" ) ? 1 : -1; + numStr = numStr.mid( 1 ); + } -/*! - Controls whether or not the dw dock window's caption should appear - as a menu item on the dock window menu that lists the dock windows. - \param dw - window - \param a - if it is true, then it appears in menu -*/ -void QtxMainWindow::setAppropriate( QDockWindow* dw, bool a ) -{ - QMainWindow::setAppropriate( dw, myStatusBar != dw && myMenuBar != dw && a ); -} + percent = numStr.endsWith( "%" ); + if ( percent ) + numStr = numStr.mid( 0, numStr.length() - 1 ); -/*! - Sets up layout -*/ -void QtxMainWindow::setUpLayout() -{ - QMainWindow::setUpLayout(); + bool ok = false; + num = numStr.toInt( &ok ); + if ( !ok ) + res = 0; - if ( myMenuBar && layout() ) - layout()->setMenuBar( 0 ); + return res; } /*! - SLOT: called on object destroyed, clears internal fields in case of deletion of menu bar or status bar + \brief Called when child object (menu bar, status bar) is destroyed. + + Clears internal pointer to prevent crashes. + + \param obj signal sender (object being destroyed) */ void QtxMainWindow::onDestroyed( QObject* obj ) { @@ -400,54 +409,3 @@ void QtxMainWindow::onDestroyed( QObject* obj ) } } -/*! - \return flag of window state by it's name - \param str - name of flag -*/ -int QtxMainWindow::windowState( const QString& str ) const -{ - static QMap winStateMap; - if ( winStateMap.isEmpty() ) - { - winStateMap["normal"] = WS_Normal; - winStateMap["min"] = WS_Minimized; - winStateMap["mini"] = WS_Minimized; - winStateMap["minimized"] = WS_Minimized; - winStateMap["max"] = WS_Maximized; - winStateMap["maxi"] = WS_Maximized; - winStateMap["maximized"] = WS_Maximized; - winStateMap["hidden"] = WS_Hidden; - winStateMap["hided"] = WS_Hidden; - winStateMap["hide"] = WS_Hidden; - winStateMap["invisible"] = WS_Hidden; - } - - int res = -1; - QString stateStr = str.stripWhiteSpace().lower(); - if ( winStateMap.contains( stateStr ) ) - res = winStateMap[stateStr]; - return res; -} - -/*! - \return flag of position by it's name - \param str - name of position -*/ -int QtxMainWindow::windowPosition( const QString& str ) const -{ - static QMap winPosMap; - if ( winPosMap.isEmpty() ) - { - winPosMap["center"] = WP_Center; - winPosMap["left"] = WP_Left; - winPosMap["right"] = WP_Right; - winPosMap["top"] = WP_Top; - winPosMap["bottom"] = WP_Bottom; - } - - int res = WP_Absolute; - QString posStr = str.stripWhiteSpace().lower(); - if ( winPosMap.contains( posStr ) ) - res = winPosMap[posStr]; - return res; -} diff --git a/src/Qtx/QtxMainWindow.h b/src/Qtx/QtxMainWindow.h index ee779aefd..c67ab2688 100644 --- a/src/Qtx/QtxMainWindow.h +++ b/src/Qtx/QtxMainWindow.h @@ -24,9 +24,8 @@ #include "Qtx.h" -#include +#include -class QDockWindow; class QtxResourceMgr; class QTX_EXPORT QtxMainWindow : public QMainWindow @@ -35,11 +34,8 @@ class QTX_EXPORT QtxMainWindow : public QMainWindow class Filter; - enum { WS_Normal, WS_Minimized, WS_Maximized, WS_Hidden }; - enum { WP_Absolute, WP_Center, WP_Left, WP_Right, WP_Top = WP_Left, WP_Bottom = WP_Right }; - public: - QtxMainWindow( QWidget* = 0, const char* = 0, WFlags = WType_TopLevel ); + QtxMainWindow( QWidget* = 0, Qt::WindowFlags = 0 ); virtual ~QtxMainWindow(); bool isDockableMenuBar() const; @@ -48,31 +44,18 @@ public: bool isDockableStatusBar() const; void setDockableStatusBar( const bool ); - void loadGeometry( QtxResourceMgr*, const QString& ); - void saveGeometry( QtxResourceMgr*, const QString& ) const; - - virtual bool eventFilter( QObject*, QEvent* ); - -public slots: - virtual void show(); - virtual void setAppropriate( QDockWindow*, bool ); - -protected: - virtual void setUpLayout(); - virtual void customEvent( QCustomEvent* ); + QString storeGeometry() const; + void retrieveGeometry( const QString& ); private slots: void onDestroyed( QObject* ); private: - int windowState( const QString& ) const; - int windowPosition( const QString& ) const; - int relativeCoordinate( const int, const int, const int ) const; + int geometryValue( const QString&, int&, bool& ) const; private: - int myMode; - QDockWindow* myMenuBar; - QDockWindow* myStatusBar; + QToolBar* myMenuBar; //!< dockable menu bar + QToolBar* myStatusBar; //!< dockable status bar }; -#endif +#endif // QTXMAINWINDOW_H diff --git a/src/Qtx/QtxMenuButton.cxx b/src/Qtx/QtxMenuButton.cxx index dc8abdde7..a9d51088a 100755 --- a/src/Qtx/QtxMenuButton.cxx +++ b/src/Qtx/QtxMenuButton.cxx @@ -380,11 +380,7 @@ void QtxMenuButton::drawButtonLabel( QPainter* p ) if ( hasFocus() ) flags |= QStyle::Style_HasFocus; */ -#if QT_VER < 3 - QRect r = rect(); -#else QRect r = style().subRect( QStyle::SR_PushButtonContents, this ); -#endif if ( myArrow && myPopup && myPopup->count() ) {