diff options
-rw-r--r-- | src/kernel/qstyle.cpp | 94 | ||||
-rw-r--r-- | src/kernel/qstyle.h | 77 | ||||
-rw-r--r-- | src/kernel/qwidget.cpp | 13 | ||||
-rw-r--r-- | src/kernel/qwidget.h | 2 | ||||
-rw-r--r-- | src/styles/qcdestyle.cpp | 6 | ||||
-rw-r--r-- | src/styles/qcdestyle.h | 6 | ||||
-rw-r--r-- | src/styles/qcommonstyle.cpp | 761 | ||||
-rw-r--r-- | src/styles/qcommonstyle.h | 24 | ||||
-rw-r--r-- | src/styles/qcompactstyle.cpp | 8 | ||||
-rw-r--r-- | src/styles/qcompactstyle.h | 8 | ||||
-rw-r--r-- | src/styles/qmotifplusstyle.cpp | 24 | ||||
-rw-r--r-- | src/styles/qmotifplusstyle.h | 24 | ||||
-rw-r--r-- | src/styles/qmotifstyle.cpp | 24 | ||||
-rw-r--r-- | src/styles/qmotifstyle.h | 24 | ||||
-rw-r--r-- | src/styles/qplatinumstyle.cpp | 12 | ||||
-rw-r--r-- | src/styles/qplatinumstyle.h | 12 | ||||
-rw-r--r-- | src/styles/qsgistyle.cpp | 26 | ||||
-rw-r--r-- | src/styles/qsgistyle.h | 26 | ||||
-rw-r--r-- | src/styles/qwindowsstyle.cpp | 32 | ||||
-rw-r--r-- | src/styles/qwindowsstyle.h | 28 |
20 files changed, 631 insertions, 600 deletions
diff --git a/src/kernel/qstyle.cpp b/src/kernel/qstyle.cpp index 4e689c2..c7f4ef4 100644 --- a/src/kernel/qstyle.cpp +++ b/src/kernel/qstyle.cpp @@ -54,7 +54,6 @@ #include <limits.h> - class QStylePrivate { public: @@ -495,7 +494,7 @@ void QStyle::unPolish( QWidget *widget ) { \sa unPolish() */ -void QStyle::polish( QStyleControlElementData ceData, ControlElementFlags, void *ptr ) { +void QStyle::polish( const QStyleControlElementData &ceData, ControlElementFlags, void *ptr ) { if (ceData.widgetObjectTypes.contains("QWidget")) { // Enable dynamic hide/show of accelerator shortcuts QWidget* widget = reinterpret_cast<QWidget*>(ptr); @@ -513,7 +512,7 @@ void QStyle::polish( QStyleControlElementData ceData, ControlElementFlags, void \sa polish() */ -void QStyle::unPolish( QStyleControlElementData ceData, ControlElementFlags, void *ptr ) { +void QStyle::unPolish( const QStyleControlElementData &ceData, ControlElementFlags, void *ptr ) { if (ceData.widgetObjectTypes.contains("QWidget")) { // Disable dynamic hide/show of accelerator shortcuts QWidget* widget = reinterpret_cast<QWidget*>(ptr); @@ -555,7 +554,7 @@ void QStyle::unPolish( QApplication *app ) { \sa unPolish() */ -void QStyle::applicationPolish( QStyleControlElementData, ControlElementFlags, void * ) { +void QStyle::applicationPolish( const QStyleControlElementData&, ControlElementFlags, void * ) { // } @@ -571,7 +570,7 @@ void QStyle::applicationPolish( QStyleControlElementData, ControlElementFlags, v \sa polish() */ -void QStyle::applicationUnPolish( QStyleControlElementData, ControlElementFlags, void * ) { +void QStyle::applicationUnPolish( const QStyleControlElementData&, ControlElementFlags, void * ) { // } @@ -605,7 +604,7 @@ void QStyle::polishPopupMenu( QPopupMenu *pm ) { (\l{QPopupMenu::setMouseTracking()}) and whether the menu is checkable by default (\l{QPopupMenu::setCheckable()}). */ -void QStyle::polishPopupMenu( QStyleControlElementData, ControlElementFlags, void * ) +void QStyle::polishPopupMenu( const QStyleControlElementData&, ControlElementFlags, void * ) { } @@ -909,7 +908,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn void QStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags flags, const QStyleOption& opt) const + \fn void QStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags flags, const QStyleOption& opt) const Draws the style PrimitiveElement \a pe using the painter \a p in the area \a r. Colors are used from the color group \a cg. @@ -1042,7 +1041,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn void QStyle::drawControl( ControlElement element, QPainter *p, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags how, const QStyleOption& opt, const QWidget *widget) const + \fn void QStyle::drawControl( ControlElement element, QPainter *p, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags how, const QStyleOption& opt, const QWidget *widget) const Draws the ControlElement \a element using the painter \a p in the area \a r. Colors are used from the color group \a cg. @@ -1201,7 +1200,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn void QStyle::drawControlMask( ControlElement element, QPainter *p, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QRect &r, const QStyleOption& opt, const QWidget *widget) const + \fn void QStyle::drawControlMask( ControlElement element, QPainter *p, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QStyleOption& opt, const QWidget *widget) const Draw a bitmask for the ControlElement \a element using the painter \a p in the area \a r. See drawControl() for an explanation of the @@ -1274,7 +1273,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn QRect QStyle::subRect( SubRect subrect, const QStyleControlElementData ceData, const ControlElementFlags elementFlags, const QWidget *widget ) const; + \fn QRect QStyle::subRect( SubRect subrect, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QWidget *widget ) const; Returns the sub-area \a subrect for the \a widget in logical coordinates. @@ -1406,7 +1405,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn void QStyle::drawComplexControl( ComplexControl control, QPainter *p, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags how, SCFlags sub, SCFlags subActive, const QStyleOption& opt, const QWidget *widget ) const + \fn void QStyle::drawComplexControl( ComplexControl control, QPainter *p, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags how, SCFlags sub, SCFlags subActive, const QStyleOption& opt, const QWidget *widget ) const Draws the ComplexControl \a control using the painter \a p in the area \a r. Colors are used from the color group \a cg. The \a sub @@ -1504,7 +1503,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn void QStyle::drawComplexControlMask( ComplexControl control, QPainter *p, const QStyleControlElementData ceData, const ControlElementFlags elementFlags, const QRect &r, const QStyleOption& opt, const QWidget *widget) const + \fn void QStyle::drawComplexControlMask( ComplexControl control, QPainter *p, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QRect &r, const QStyleOption& opt, const QWidget *widget) const Draw a bitmask for the ComplexControl \a control using the painter \a p in the area \a r. See drawComplexControl() for an explanation @@ -1524,7 +1523,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn QRect QStyle::querySubControlMetrics( ComplexControl control, QStyleControlElementData ceData, ControlElementFlags elementFlags, SubControl subcontrol, const QStyleOption& opt = QStyleOption::Default, const QWidget *widget = 0 ) const; + \fn QRect QStyle::querySubControlMetrics( ComplexControl control, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl subcontrol, const QStyleOption& opt = QStyleOption::Default, const QWidget *widget = 0 ) const; Returns the rect for the SubControl \a subcontrol for \a widget in logical coordinates. @@ -1546,7 +1545,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn SubControl QStyle::querySubControl( ComplexControl control, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QPoint &pos, const QStyleOption& opt = QStyleOption::Default, const QWidget *widget = 0 ) const; + \fn SubControl QStyle::querySubControl( ComplexControl control, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QPoint &pos, const QStyleOption& opt = QStyleOption::Default, const QWidget *widget = 0 ) const; Returns the SubControl for \a widget at the point \a pos. The \a widget argument is a pointer to a QWidget or one of its @@ -1672,7 +1671,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn int QStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; + \fn int QStyle::pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; Returns the pixel metric for \a metric. @@ -1734,7 +1733,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn QSize QStyle::sizeFromContents( ContentsType contents, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& opt = QStyleOption::Default, const QWidget *widget = 0 ) const; + \fn QSize QStyle::sizeFromContents( ContentsType contents, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& opt = QStyleOption::Default, const QWidget *widget = 0 ) const; Returns the size of \a widget based on the contents size \a contentsSize. @@ -1924,7 +1923,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn int QStyle::styleHint( StyleHint stylehint, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption &opt = QStyleOption::Default, QStyleHintReturn *returnData = 0, const QWidget *widget = 0 ) const; + \fn int QStyle::styleHint( StyleHint stylehint, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &opt = QStyleOption::Default, QStyleHintReturn *returnData = 0, const QWidget *widget = 0 ) const; Returns the style hint \a stylehint for \a widget. Currently, \a widget, \a opt, and \a returnData are unused; they're included to @@ -1971,7 +1970,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, */ /*! - \fn QPixmap QStyle::stylePixmap( StylePixmap stylepixmap, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption& opt = QStyleOption::Default, const QWidget *widget = 0 ) const; + \fn QPixmap QStyle::stylePixmap( StylePixmap stylepixmap, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption& opt = QStyleOption::Default, const QWidget *widget = 0 ) const; Returns a pixmap for \a stylepixmap. @@ -2011,7 +2010,7 @@ void QStyle::drawItem( QPainter *p, const QRect &r, function is provided to aid style implementors in supporting right-to-left mode. - Note that this function is deprecated in favor of visualRect( const QRect &logical, const QStyleControlElementData ceData, const ControlElementFlags elementFlags ); + Note that this function is deprecated in favor of visualRect( const QRect &logical, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags ); \sa QApplication::reverseLayout() */ @@ -2023,7 +2022,7 @@ QRect QStyle::visualRect( const QRect &logical, const QWidget *w ) } /*! - \fn QRect QStyle::visualRect( const QRect &logical, const QStyleControlElementData ceData, const ControlElementFlags elementFlags ); + \fn QRect QStyle::visualRect( const QRect &logical, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags ); Returns the rect \a logical in screen coordinates. The bounding rect for the widget described by \a ceData and \a elementFlags @@ -2033,7 +2032,7 @@ QRect QStyle::visualRect( const QRect &logical, const QWidget *w ) \sa QApplication::reverseLayout() */ -QRect QStyle::visualRect( const QRect &logical, const QStyleControlElementData ceData, const ControlElementFlags elementFlags ) +QRect QStyle::visualRect( const QRect &logical, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags ) { Q_UNUSED(elementFlags) @@ -2065,15 +2064,15 @@ QRect QStyle::visualRect( const QRect &logical, const QRect &boundingRect ) } /*! - \fn void QStyle::installObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ); + \fn void QStyle::installObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ); Intercepts events generated by \a source and sends them to \a handler via - the bool QStyle::objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) virtual method. + the bool QStyle::objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) virtual method. \sa void QStyle::removeObjectEventHandler( QObject* source, QStyle* handler ) - \sa bool QStyle::objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) + \sa bool QStyle::objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) */ -void QStyle::installObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) { +void QStyle::installObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) { bool cbret = false; if (m_eventHandlerInstallationHook) { cbret = (*m_eventHandlerInstallationHook)(ceData, elementFlags, source, handler); @@ -2090,13 +2089,13 @@ void QStyle::installObjectEventHandler( QStyleControlElementData ceData, Control } /*! - \fn void QStyle::removeObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ); + \fn void QStyle::removeObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ); Stops intercepting events generated by \a source. - \sa void QStyle::installObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) + \sa void QStyle::installObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) */ -void QStyle::removeObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) { +void QStyle::removeObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) { bool cbret = false; if (m_eventHandlerRemovalHook) { cbret = (*m_eventHandlerRemovalHook)(ceData, elementFlags, source, handler); @@ -2117,9 +2116,9 @@ void QStyle::removeObjectEventHandler( QStyleControlElementData ceData, ControlE Sets a callback function \a hook which will be called whenever a new intercept request is made via the QStyle::installObjectEventHandler method. The callback function must - use this definition: bool callbackFunction( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ). + use this definition: bool callbackFunction( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ). - \sa void QStyle::installObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) + \sa void QStyle::installObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) */ void QStyle::setEventHandlerInstallationHook( EventHandlerInstallationHook hook ) { m_eventHandlerInstallationHook = hook; @@ -2130,24 +2129,24 @@ void QStyle::setEventHandlerInstallationHook( EventHandlerInstallationHook hook Sets a callback function \a hook which will be called whenever a new intercept deactivation request is made via the QStyle::removeObjectEventHandler method. The callback function must - use this definition: bool callbackFunction( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ). + use this definition: bool callbackFunction( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ). - \sa void QStyle::removeObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) + \sa void QStyle::removeObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) */ void QStyle::setEventHandlerRemovalHook( EventHandlerRemovalHook hook ) { m_eventHandlerRemovalHook = hook; } /*! - \fn bool QStyle::objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); + \fn bool QStyle::objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); Override this virtual function to intercept events requested by a previous call to QStyle::installObjectEventHandler. - \sa void QStyle::installObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) - \sa void QStyle::removeObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) + \sa void QStyle::installObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) + \sa void QStyle::removeObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) */ -bool QStyle::objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) { +bool QStyle::objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) { Q_UNUSED(ceData); Q_UNUSED(elementFlags); Q_UNUSED(source); @@ -2193,20 +2192,20 @@ bool QStyle::eventFilter(QObject *o, QEvent *e) { Sets a callback function \a hook which will be called whenever a new widget action request is made via the QStyle::installObjectEventHandler method. The callback function must - use this definition: bool callbackFunction( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ). + use this definition: bool callbackFunction( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ). - \sa void QStyle::installObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) + \sa void QStyle::installObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) */ void QStyle::setWidgetActionRequestHook( WidgetActionRequestHook hook ) { m_widgetActionRequestHook = hook; } /*! - \fn bool widgetActionRequestHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request ); + \fn bool widgetActionRequestHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request ); Handles widget action requests. Return FALSE to continue processing in base classes, TRUE to eat the request and halt processing. */ -bool QStyle::widgetActionRequest( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, QStyleWidgetActionRequestData requestData ) { +bool QStyle::widgetActionRequest( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, QStyleWidgetActionRequestData requestData ) { bool cbret = false; if (m_widgetActionRequestHook) { cbret = (*m_widgetActionRequestHook)(ceData, elementFlags, source, request, requestData); @@ -2327,20 +2326,20 @@ bool QStyle::widgetActionRequest( QStyleControlElementData ceData, ControlElemen Sets a callback function \a hook which will be called whenever a new application action request is made via the QStyle::installObjectEventHandler method. The callback function must - use this definition: bool callbackFunction( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ). + use this definition: bool callbackFunction( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ). - \sa void QStyle::installObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) + \sa void QStyle::installObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ) */ void QStyle::setApplicationActionRequestHook( ApplicationActionRequestHook hook ) { m_applicationActionRequestHook = hook; } /*! - \fn bool applicationActionRequestHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request ); + \fn bool applicationActionRequestHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request ); Handles application action requests. Return FALSE to continue processing in base classes, TRUE to eat the request and halt processing. */ -bool QStyle::applicationActionRequest( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, QStyleApplicationActionRequestData requestData ) { +bool QStyle::applicationActionRequest( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, QStyleApplicationActionRequestData requestData ) { bool cbret = false; if (m_applicationActionRequestHook) { cbret = (*m_applicationActionRequestHook)(ceData, elementFlags, source, request, requestData); @@ -2579,7 +2578,11 @@ QSize QStyle::sizeFromContents(ContentsType contents, int QStyle::styleHint(StyleHint sh, const QWidget * w, const QStyleOption &so, QStyleHintReturn *shr) const { - QStyleControlElementData ceData = populateControlElementDataFromWidget(w, so, false); + bool ceDataNotNeeded = false; + if (sh == SH_Widget_ShareActivation) { + ceDataNotNeeded = true; + } + QStyleControlElementData ceData = populateControlElementDataFromWidget(w, so, false, ceDataNotNeeded); return styleHint(sh, ceData, getControlElementFlagsForObject(w, ceData.widgetObjectTypes, QStyleOption(), false), so, shr, w); } @@ -2605,6 +2608,7 @@ QPixmap QStyle::stylePixmap(StylePixmap sp, const QWidget *w, const QStyleOption */ QStyleControlElementData::QStyleControlElementData() { + isNull = true; activePainter = 0; tickMarkSetting = 0; comboBoxLineEditFlags = 0; diff --git a/src/kernel/qstyle.h b/src/kernel/qstyle.h index f76b970..cf7a235 100644 --- a/src/kernel/qstyle.h +++ b/src/kernel/qstyle.h @@ -228,6 +228,10 @@ class QStyleControlElementTabBarData { class Q_EXPORT QStyleControlElementData { public: + QStyleControlElementData(); + + public: + bool isNull; QStringList widgetObjectTypes; bool allDataPopulated; Qt::WFlags wflags; @@ -286,9 +290,6 @@ class Q_EXPORT QStyleControlElementData { QString caption; QStyleControlElementGenericWidgetData topLevelWidgetData; Q_UINT32 topLevelWidgetFlags; - - public: - QStyleControlElementData(); }; class Q_EXPORT QStyleWidgetActionRequestData { @@ -360,28 +361,28 @@ public: virtual void polish( QWidget * ); // New API - virtual void polish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void polish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); // Old API // DEPRECATED virtual void unPolish( QWidget * ); // New API - virtual void unPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void unPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); // Old API // DEPRECATED virtual void polish( QApplication * ); // New API - virtual void applicationPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void applicationPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); // Old API // DEPRECATED virtual void unPolish( QApplication * ); // New API - virtual void applicationUnPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void applicationUnPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); virtual void polish( QPalette & ); @@ -390,7 +391,7 @@ public: virtual void polishPopupMenu( QPopupMenu* ); // New API - virtual void polishPopupMenu( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ) = 0; + virtual void polishPopupMenu( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ) = 0; virtual QRect itemRect( QPainter *p, const QRect &r, int flags, bool enabled, @@ -521,7 +522,7 @@ public: // New API virtual void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -576,7 +577,7 @@ public: // New API virtual void drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -595,7 +596,7 @@ public: // New API virtual void drawControlMask( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QStyleOption& = QStyleOption::Default, @@ -646,7 +647,7 @@ public: virtual QRect subRect( SubRect r, const QWidget *widget ) const; // New API - virtual QRect subRect( SubRect r, const QStyleControlElementData ceData, const ControlElementFlags elementFlags, const QWidget *widget ) const = 0; + virtual QRect subRect( SubRect r, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QWidget *widget ) const = 0; enum ComplexControl{ @@ -728,7 +729,7 @@ public: virtual void drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -753,7 +754,7 @@ public: // New API virtual void drawComplexControlMask( ComplexControl control, QPainter *p, - const QStyleControlElementData ceData, + const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QRect &r, const QStyleOption& = QStyleOption::Default, @@ -768,7 +769,7 @@ public: // New API virtual QRect querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const QStyleOption& = QStyleOption::Default, @@ -783,7 +784,7 @@ public: // New API virtual SubControl querySubControl( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QPoint &pos, const QStyleOption& = QStyleOption::Default, @@ -872,7 +873,7 @@ public: // New API virtual int pixelMetric( PixelMetric metric, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const = 0; @@ -909,7 +910,7 @@ public: const QStyleOption& = QStyleOption::Default ) const; virtual QSize sizeFromContents( ContentsType contents, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& = QStyleOption::Default, @@ -1083,7 +1084,7 @@ public: // New API virtual int styleHint( StyleHint stylehint, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption& = QStyleOption::Default, QStyleHintReturn* returnData = 0, @@ -1115,7 +1116,7 @@ public: const QStyleOption& = QStyleOption::Default ) const; virtual QPixmap stylePixmap( StylePixmap stylepixmap, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const = 0; @@ -1126,7 +1127,7 @@ public: static QRect visualRect( const QRect &logical, const QWidget *w ); // New API - static QRect visualRect( const QRect &logical, const QStyleControlElementData ceData, const ControlElementFlags elementFlags ); + static QRect visualRect( const QRect &logical, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags ); static QRect visualRect( const QRect &logical, const QRect &bounding ); @@ -1135,13 +1136,13 @@ public: typedef QMap<void*, QStyle*> ObjectEventSourceToHandlerMap; typedef QMap<void*, QStyleControlElementData> ObjectEventSourceDataToHandlerMap; typedef QMap<void*, ControlElementFlags> ObjectEventSourceFlagsToHandlerMap; - typedef bool (*EventHandlerInstallationHook)(QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler); - typedef bool (*EventHandlerRemovalHook)(QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler); - void installObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ); - void removeObjectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ); + typedef bool (*EventHandlerInstallationHook)(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler); + typedef bool (*EventHandlerRemovalHook)(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler); + void installObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ); + void removeObjectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QStyle* handler ); void setEventHandlerInstallationHook( EventHandlerInstallationHook ); void setEventHandlerRemovalHook( EventHandlerRemovalHook hook ); - virtual bool objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); + virtual bool objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); enum WidgetActionRequest { WAR_Repaint, @@ -1165,37 +1166,40 @@ public: WAR_SendPaintEvent }; - typedef bool (*WidgetActionRequestHook)(QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, QStyleWidgetActionRequestData requestData); + typedef bool (*WidgetActionRequestHook)(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, QStyleWidgetActionRequestData requestData); void setWidgetActionRequestHook( WidgetActionRequestHook ); - virtual bool widgetActionRequest( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, QStyleWidgetActionRequestData requestData = QStyleWidgetActionRequestData() ); + virtual bool widgetActionRequest( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, QStyleWidgetActionRequestData requestData = QStyleWidgetActionRequestData() ); enum ApplicationActionRequest { AAR_SetPalette, AAR_SetFont }; - typedef bool (*ApplicationActionRequestHook)(QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, QStyleApplicationActionRequestData requestData); + typedef bool (*ApplicationActionRequestHook)(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, QStyleApplicationActionRequestData requestData); void setApplicationActionRequestHook( ApplicationActionRequestHook ); - virtual bool applicationActionRequest( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, QStyleApplicationActionRequestData requestData = QStyleApplicationActionRequestData() ); + virtual bool applicationActionRequest( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, QStyleApplicationActionRequestData requestData = QStyleApplicationActionRequestData() ); // Old 2.x QStyle API #ifndef QT_NO_COMPAT int defaultFrameWidth() const { - return pixelMetric( PM_DefaultFrameWidth, QStyleControlElementData(), CEF_None ); + QStyleControlElementData ceData; + return pixelMetric( PM_DefaultFrameWidth, ceData, CEF_None ); } void tabbarMetrics( const QWidget* t, int& hf, int& vf, int& ov ) const { - hf = pixelMetric( PM_TabBarTabHSpace, QStyleControlElementData(), CEF_None, t ); - vf = pixelMetric( PM_TabBarTabVSpace, QStyleControlElementData(), CEF_None, t ); - ov = pixelMetric( PM_TabBarBaseOverlap, QStyleControlElementData(), CEF_None, t ); + QStyleControlElementData ceData; + hf = pixelMetric( PM_TabBarTabHSpace, ceData, CEF_None, t ); + vf = pixelMetric( PM_TabBarTabVSpace, ceData, CEF_None, t ); + ov = pixelMetric( PM_TabBarBaseOverlap, ceData, CEF_None, t ); } QSize scrollBarExtent() const { - return QSize(pixelMetric(PM_ScrollBarExtent, QStyleControlElementData(), CEF_None), - pixelMetric(PM_ScrollBarExtent, QStyleControlElementData(), CEF_None)); + QStyleControlElementData ceData; + return QSize(pixelMetric(PM_ScrollBarExtent, ceData, CEF_None), + pixelMetric(PM_ScrollBarExtent, ceData, CEF_None)); } #endif @@ -1231,6 +1235,7 @@ Q_EXPORT QStyleControlElementData populateControlElementDataFromWidget(const QWi Q_EXPORT QStyleControlElementData populateControlElementDataFromApplication(const QApplication* app, const QStyleOption& opt, bool populateReliantFields=true); Q_EXPORT QStyle::ControlElementFlags getControlElementFlagsForObject(const QObject* object, QStringList objectTypeList, const QStyleOption& opt, bool populateReliantFields=true); Q_EXPORT QStringList getObjectTypeListForObject(const QObject* object); +Q_EXPORT QStyleControlElementData populateControlElementDataFromWidget(const QWidget* widget, const QStyleOption& opt, bool populateReliantFields, bool populateMinimumNumberOfFields); #endif // QT_NO_STYLE #endif // QSTYLE_H diff --git a/src/kernel/qwidget.cpp b/src/kernel/qwidget.cpp index 28328b8..704681d 100644 --- a/src/kernel/qwidget.cpp +++ b/src/kernel/qwidget.cpp @@ -1184,6 +1184,9 @@ void QWidget::createExtra() #endif extra->size_policy = QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); + + extra->m_ceData = NULL; + createSysExtra(); } } @@ -3591,7 +3594,15 @@ bool QWidget::isActiveWindow() const if(tlw == qApp->activeWindow() || ( isVisible() && tlw->isPopup() )) return TRUE; #ifndef QT_NO_STYLE - if(style().styleHint(QStyle::SH_Widget_ShareActivation, this )) { + const_cast<QWidget*>(this)->createExtra(); + if (!extra->m_ceData) { + const_cast<QWidget*>(this)->extra->m_ceData = new QStyleControlElementData(); + } + //extra->m_ceData->widgetObjectTypes = getObjectTypeListForObject(this); + extra->m_ceData->widgetObjectTypes.clear(); + extra->m_ceData->allDataPopulated = false; + //if(style().styleHint(QStyle::SH_Widget_ShareActivation, *extra->m_ceData, getControlElementFlagsForObject(this, extra->m_ceData->widgetObjectTypes, QStyleOption(), false), QStyleOption(), NULL, this)) { + if(style().styleHint(QStyle::SH_Widget_ShareActivation, *extra->m_ceData, QStyle::CEF_None, QStyleOption(), NULL, this)) { if((tlw->isDialog() || (tlw->testWFlags(Qt::WStyle_Tool) && !tlw->isPopup())) && !tlw->testWFlags(Qt::WShowModal) && (!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow())) diff --git a/src/kernel/qwidget.h b/src/kernel/qwidget.h index 9df9710..44bb24e 100644 --- a/src/kernel/qwidget.h +++ b/src/kernel/qwidget.h @@ -63,6 +63,7 @@ class QFocusData; class QCursor; class QWSRegionManager; class QStyle; +class QStyleControlElementData; class Q_EXPORT QWidget : public QObject, public QPaintDevice { @@ -1086,6 +1087,7 @@ struct Q_EXPORT QWExtra { #endif QRect micro_focus_hint; // micro focus hint QSizePolicy size_policy; + QStyleControlElementData* m_ceData; }; #define Q_DEFINED_QWIDGET diff --git a/src/styles/qcdestyle.cpp b/src/styles/qcdestyle.cpp index 3719462..629acb8 100644 --- a/src/styles/qcdestyle.cpp +++ b/src/styles/qcdestyle.cpp @@ -87,7 +87,7 @@ QCDEStyle::~QCDEStyle() /*!\reimp */ -int QCDEStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const +int QCDEStyle::pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const { int ret; @@ -112,7 +112,7 @@ int QCDEStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, */ void QCDEStyle::drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -144,7 +144,7 @@ void QCDEStyle::drawControl( ControlElement element, */ void QCDEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, diff --git a/src/styles/qcdestyle.h b/src/styles/qcdestyle.h index 3dee332..6a4c562 100644 --- a/src/styles/qcdestyle.h +++ b/src/styles/qcdestyle.h @@ -62,11 +62,11 @@ public: QCDEStyle( bool useHighlightCols = FALSE ); virtual ~QCDEStyle(); - int pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; + int pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; void drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -76,7 +76,7 @@ public: void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp index a0e64d0..a44ee9f 100644 --- a/src/styles/qcommonstyle.cpp +++ b/src/styles/qcommonstyle.cpp @@ -251,421 +251,430 @@ QStyle::ControlElementFlags getControlElementFlagsForObject(const QObject* objec } QStyleControlElementData populateControlElementDataFromWidget(const QWidget* widget, const QStyleOption& opt, bool populateReliantFields) { + return populateControlElementDataFromWidget(widget, opt, populateReliantFields, false); +} + +QStyleControlElementData populateControlElementDataFromWidget(const QWidget* widget, const QStyleOption& opt, bool populateReliantFields, bool populateMinimumNumberOfFields) { QStyleControlElementData ceData; if (widget) { + ceData.isNull = false; ceData.widgetObjectTypes = getObjectTypeListForObject(widget); - ceData.allDataPopulated = populateReliantFields; - const QPixmap* erasePixmap = widget->backgroundPixmap(); - if (erasePixmap) { - ceData.bgPixmap = *erasePixmap; - } - if (populateReliantFields) { - ceData.bgBrush = widget->backgroundBrush(); + ceData.allDataPopulated = populateReliantFields & populateMinimumNumberOfFields; + if (!populateMinimumNumberOfFields) { + const QPixmap* erasePixmap = widget->backgroundPixmap(); + if (erasePixmap) { + ceData.bgPixmap = *erasePixmap; + } + if (populateReliantFields) { + ceData.bgBrush = widget->backgroundBrush(); + ceData.windowState = (Qt::WindowState)(widget->windowState()); + } } ceData.wflags = widget->getWFlags(); - if (populateReliantFields) { - ceData.windowState = (Qt::WindowState)(widget->windowState()); - } - ceData.bgColor = widget->eraseColor(); - ceData.bgOffset = widget->backgroundOffset(); - ceData.backgroundMode = widget->backgroundMode(); - if (populateReliantFields) { - ceData.fgColor = widget->foregroundColor(); - ceData.colorGroup = widget->colorGroup(); - ceData.paletteBgColor = widget->paletteBackgroundColor(); - } - ceData.geometry = widget->geometry(); - ceData.rect = widget->rect(); - ceData.pos = widget->pos(); - const QPixmap* icon = widget->icon(); - if (icon) { - ceData.icon = *icon; + if (!populateMinimumNumberOfFields) { + ceData.bgColor = widget->eraseColor(); + ceData.bgOffset = widget->backgroundOffset(); + ceData.backgroundMode = widget->backgroundMode(); + if (populateReliantFields) { + ceData.fgColor = widget->foregroundColor(); + ceData.colorGroup = widget->colorGroup(); + ceData.paletteBgColor = widget->paletteBackgroundColor(); + } + ceData.geometry = widget->geometry(); + ceData.rect = widget->rect(); + ceData.pos = widget->pos(); + const QPixmap* icon = widget->icon(); + if (icon) { + ceData.icon = *icon; + } + ceData.palette = widget->palette(); + ceData.font = widget->font(); } - ceData.palette = widget->palette(); - ceData.font = widget->font(); ceData.name = widget->name(); ceData.caption = widget->caption(); - if (ceData.widgetObjectTypes.contains("QPushButton")) { - const QPushButton *button = dynamic_cast<const QPushButton*>(widget); - if (button) { - QIconSet* iconSet = 0; - const QPixmap* fgPixmap = 0; - iconSet = button->iconSet(); - fgPixmap = button->pixmap(); - if (iconSet) { - ceData.iconSet = *iconSet; - } - if (fgPixmap) { - ceData.fgPixmap = *fgPixmap; + if (!populateMinimumNumberOfFields) { + if (ceData.widgetObjectTypes.contains("QPushButton")) { + const QPushButton *button = dynamic_cast<const QPushButton*>(widget); + if (button) { + QIconSet* iconSet = 0; + const QPixmap* fgPixmap = 0; + iconSet = button->iconSet(); + fgPixmap = button->pixmap(); + if (iconSet) { + ceData.iconSet = *iconSet; + } + if (fgPixmap) { + ceData.fgPixmap = *fgPixmap; + } } } - } - if (ceData.widgetObjectTypes.contains("QToolButton")) { - const QToolButton *button = dynamic_cast<const QToolButton*>(widget); - if (button) { - const QPixmap* fgPixmap = 0; - ceData.iconSet = button->iconSet(); - fgPixmap = button->pixmap(); - if (fgPixmap) { - ceData.fgPixmap = *fgPixmap; + if (ceData.widgetObjectTypes.contains("QToolButton")) { + const QToolButton *button = dynamic_cast<const QToolButton*>(widget); + if (button) { + const QPixmap* fgPixmap = 0; + ceData.iconSet = button->iconSet(); + fgPixmap = button->pixmap(); + if (fgPixmap) { + ceData.fgPixmap = *fgPixmap; + } + ceData.textLabel = button->textLabel(); + ceData.toolButtonTextPosition = button->textPosition(); + ceData.popupDelay = button->popupDelay(); } - ceData.textLabel = button->textLabel(); - ceData.toolButtonTextPosition = button->textPosition(); - ceData.popupDelay = button->popupDelay(); } - } - if (ceData.widgetObjectTypes.contains("QCheckBox")) { - const QCheckBox *button = dynamic_cast<const QCheckBox*>(widget); - if (button) { - const QPixmap* fgPixmap = 0; - fgPixmap = button->pixmap(); - if (fgPixmap) { - ceData.fgPixmap = *fgPixmap; + if (ceData.widgetObjectTypes.contains("QCheckBox")) { + const QCheckBox *button = dynamic_cast<const QCheckBox*>(widget); + if (button) { + const QPixmap* fgPixmap = 0; + fgPixmap = button->pixmap(); + if (fgPixmap) { + ceData.fgPixmap = *fgPixmap; + } } } - } - if (ceData.widgetObjectTypes.contains("QRadioButton")) { - const QRadioButton *button = dynamic_cast<const QRadioButton*>(widget); - if (button) { - const QPixmap* fgPixmap = 0; - fgPixmap = button->pixmap(); - if (fgPixmap) { - ceData.fgPixmap = *fgPixmap; + if (ceData.widgetObjectTypes.contains("QRadioButton")) { + const QRadioButton *button = dynamic_cast<const QRadioButton*>(widget); + if (button) { + const QPixmap* fgPixmap = 0; + fgPixmap = button->pixmap(); + if (fgPixmap) { + ceData.fgPixmap = *fgPixmap; + } } } - } - if (ceData.widgetObjectTypes.contains("QButton")) { - const QButton *button = dynamic_cast<const QButton*>(widget); - if (button) { - ceData.text = button->text(); - } - } - if (ceData.widgetObjectTypes.contains("QTabBar")) { - const QTabBar *tb = dynamic_cast<const QTabBar*>(widget); - if (tb) { - ceData.tabBarData.tabCount = tb->count(); - ceData.tabBarData.currentTabIndex = tb->currentTab(); - ceData.tabBarData.shape = tb->shape(); - ceData.tabBarData.identIndexMap.clear(); - const QTab* currentTab; - for (int i=0; i<tb->count(); ++i) { - currentTab = tb->tabAt(i); - if (currentTab) { - ceData.tabBarData.identIndexMap[currentTab->identifier()] = tb->indexOf(currentTab->identifier()); - } + if (ceData.widgetObjectTypes.contains("QButton")) { + const QButton *button = dynamic_cast<const QButton*>(widget); + if (button) { + ceData.text = button->text(); } - const QTabWidget *tw = dynamic_cast<const QTabWidget*>(tb->parent()); - if (tw) { - QWidget *cw; - cw = tw->cornerWidget(Qt::TopLeft); - if(cw) { - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].widgetObjectTypes = getObjectTypeListForObject(cw); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].geometry = cw->geometry(); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].rect = cw->rect(); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].pos = cw->pos(); - } - cw = tw->cornerWidget(Qt::TopRight); - if(cw) { - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].widgetObjectTypes = getObjectTypeListForObject(cw); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].geometry = cw->geometry(); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].rect = cw->rect(); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].pos = cw->pos(); - } - cw = tw->cornerWidget(Qt::BottomLeft); - if(cw) { - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].widgetObjectTypes = getObjectTypeListForObject(cw); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].geometry = cw->geometry(); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].rect = cw->rect(); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].pos = cw->pos(); + } + if (ceData.widgetObjectTypes.contains("QTabBar")) { + const QTabBar *tb = dynamic_cast<const QTabBar*>(widget); + if (tb) { + ceData.tabBarData.tabCount = tb->count(); + ceData.tabBarData.currentTabIndex = tb->currentTab(); + ceData.tabBarData.shape = tb->shape(); + ceData.tabBarData.identIndexMap.clear(); + const QTab* currentTab; + for (int i=0; i<tb->count(); ++i) { + currentTab = tb->tabAt(i); + if (currentTab) { + ceData.tabBarData.identIndexMap[currentTab->identifier()] = tb->indexOf(currentTab->identifier()); + } } - cw = tw->cornerWidget(Qt::BottomRight); - if(cw) { - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].widgetObjectTypes = getObjectTypeListForObject(cw); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].geometry = cw->geometry(); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].rect = cw->rect(); - ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].pos = cw->pos(); + const QTabWidget *tw = dynamic_cast<const QTabWidget*>(tb->parent()); + if (tw) { + QWidget *cw; + cw = tw->cornerWidget(Qt::TopLeft); + if(cw) { + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].widgetObjectTypes = getObjectTypeListForObject(cw); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].geometry = cw->geometry(); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].rect = cw->rect(); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].pos = cw->pos(); + } + cw = tw->cornerWidget(Qt::TopRight); + if(cw) { + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].widgetObjectTypes = getObjectTypeListForObject(cw); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].geometry = cw->geometry(); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].rect = cw->rect(); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].pos = cw->pos(); + } + cw = tw->cornerWidget(Qt::BottomLeft); + if(cw) { + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].widgetObjectTypes = getObjectTypeListForObject(cw); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].geometry = cw->geometry(); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].rect = cw->rect(); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].pos = cw->pos(); + } + cw = tw->cornerWidget(Qt::BottomRight); + if(cw) { + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].widgetObjectTypes = getObjectTypeListForObject(cw); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].geometry = cw->geometry(); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].rect = cw->rect(); + ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].pos = cw->pos(); + } } } } - } - if (ceData.widgetObjectTypes.contains("QToolBox")) { - const QToolBox *tb = dynamic_cast<const QToolBox*>(widget); - if (tb) { - const QWidget* currentItem = tb->currentItem(); - if (currentItem) { - ceData.activeItemPaletteBgColor = currentItem->paletteBackgroundColor(); + if (ceData.widgetObjectTypes.contains("QToolBox")) { + const QToolBox *tb = dynamic_cast<const QToolBox*>(widget); + if (tb) { + const QWidget* currentItem = tb->currentItem(); + if (currentItem) { + ceData.activeItemPaletteBgColor = currentItem->paletteBackgroundColor(); + } } } - } - if (ceData.widgetObjectTypes.contains("QProgressBar")) { - const QProgressBar *pb = dynamic_cast<const QProgressBar*>(widget); - if (pb) { - ceData.currentStep = pb->progress(); - ceData.totalSteps = pb->totalSteps(); - ceData.progressText = pb->progressString(); - ceData.percentageVisible = pb->percentageVisible(); - ceData.orientation = pb->orientation(); + if (ceData.widgetObjectTypes.contains("QProgressBar")) { + const QProgressBar *pb = dynamic_cast<const QProgressBar*>(widget); + if (pb) { + ceData.currentStep = pb->progress(); + ceData.totalSteps = pb->totalSteps(); + ceData.progressText = pb->progressString(); + ceData.percentageVisible = pb->percentageVisible(); + ceData.orientation = pb->orientation(); + } } - } - if (ceData.widgetObjectTypes.contains("QHeader")) { - const QHeader *header = dynamic_cast<const QHeader*>(widget); - if (header) { - int section = opt.headerSection(); - QIconSet* iconSet = 0; - iconSet = header->iconSet(section); - ceData.textLabel = header->label(section); - if (iconSet) { - ceData.iconSet = *iconSet; + if (ceData.widgetObjectTypes.contains("QHeader")) { + const QHeader *header = dynamic_cast<const QHeader*>(widget); + if (header) { + int section = opt.headerSection(); + QIconSet* iconSet = 0; + iconSet = header->iconSet(section); + ceData.textLabel = header->label(section); + if (iconSet) { + ceData.iconSet = *iconSet; + } } } - } - // Complex Controls - if (ceData.widgetObjectTypes.contains("QScrollBar")) { - const QScrollBar *sb = dynamic_cast<const QScrollBar*>(widget); - if (sb) { - ceData.orientation = sb->orientation(); - ceData.minSteps = sb->minValue(); - ceData.maxSteps = sb->maxValue(); - ceData.currentStep = sb->value(); - ceData.startStep = sb->sliderStart(); - ceData.lineStep = sb->lineStep(); - ceData.pageStep = sb->pageStep(); - if (populateReliantFields) { - ceData.sliderRect = sb->sliderRect(); + // Complex Controls + if (ceData.widgetObjectTypes.contains("QScrollBar")) { + const QScrollBar *sb = dynamic_cast<const QScrollBar*>(widget); + if (sb) { + ceData.orientation = sb->orientation(); + ceData.minSteps = sb->minValue(); + ceData.maxSteps = sb->maxValue(); + ceData.currentStep = sb->value(); + ceData.startStep = sb->sliderStart(); + ceData.lineStep = sb->lineStep(); + ceData.pageStep = sb->pageStep(); + if (populateReliantFields) { + ceData.sliderRect = sb->sliderRect(); + } } } - } - if (ceData.widgetObjectTypes.contains("QSlider")) { - const QSlider *sl = dynamic_cast<const QSlider*>(widget); - if (sl) { - ceData.orientation = sl->orientation(); - ceData.minSteps = sl->minValue(); - ceData.maxSteps = sl->maxValue(); - ceData.tickMarkSetting = sl->tickmarks(); - ceData.tickInterval = sl->tickInterval(); - ceData.currentStep = sl->value(); - ceData.startStep = sl->sliderStart(); - ceData.lineStep = sl->lineStep(); - ceData.pageStep = sl->pageStep(); - if (populateReliantFields) { - ceData.sliderRect = sl->sliderRect(); + if (ceData.widgetObjectTypes.contains("QSlider")) { + const QSlider *sl = dynamic_cast<const QSlider*>(widget); + if (sl) { + ceData.orientation = sl->orientation(); + ceData.minSteps = sl->minValue(); + ceData.maxSteps = sl->maxValue(); + ceData.tickMarkSetting = sl->tickmarks(); + ceData.tickInterval = sl->tickInterval(); + ceData.currentStep = sl->value(); + ceData.startStep = sl->sliderStart(); + ceData.lineStep = sl->lineStep(); + ceData.pageStep = sl->pageStep(); + if (populateReliantFields) { + ceData.sliderRect = sl->sliderRect(); + } } } - } - if (ceData.widgetObjectTypes.contains("QDialogButtons")) { - const QDialogButtons *dlgbtns = dynamic_cast<const QDialogButtons*>(widget); - if (dlgbtns) { - ceData.orientation = dlgbtns->orientation(); - ceData.dlgVisibleButtons = dlgbtns->visibleButtons(); - QDialogButtons::Button btns[] = { QDialogButtons::All, QDialogButtons::Reject, QDialogButtons::Accept, QDialogButtons::Apply, QDialogButtons::Retry, QDialogButtons::Ignore, QDialogButtons::Abort, QDialogButtons::Help }; - for(unsigned int i = 0; i < (sizeof(btns)/sizeof(btns[0])); i++) { - if (ceData.dlgVisibleButtons & btns[i]) { - ceData.dlgVisibleSizeHints[btns[i]] = dlgbtns->sizeHint(btns[i]); + if (ceData.widgetObjectTypes.contains("QDialogButtons")) { + const QDialogButtons *dlgbtns = dynamic_cast<const QDialogButtons*>(widget); + if (dlgbtns) { + ceData.orientation = dlgbtns->orientation(); + ceData.dlgVisibleButtons = dlgbtns->visibleButtons(); + QDialogButtons::Button btns[] = { QDialogButtons::All, QDialogButtons::Reject, QDialogButtons::Accept, QDialogButtons::Apply, QDialogButtons::Retry, QDialogButtons::Ignore, QDialogButtons::Abort, QDialogButtons::Help }; + for(unsigned int i = 0; i < (sizeof(btns)/sizeof(btns[0])); i++) { + if (ceData.dlgVisibleButtons & btns[i]) { + ceData.dlgVisibleSizeHints[btns[i]] = dlgbtns->sizeHint(btns[i]); + } } + } - } - } - if (ceData.widgetObjectTypes.contains("QTitleBar")) { - const QTitleBar *tb = dynamic_cast<const QTitleBar*>(widget); - if (tb) { - ceData.titleBarData.hasWindow = !!(tb->window()); - if (populateReliantFields) { - if (ceData.titleBarData.hasWindow) { - ceData.titleBarData.windowState = (Qt::WindowState)(tb->window()->windowState()); + if (ceData.widgetObjectTypes.contains("QTitleBar")) { + const QTitleBar *tb = dynamic_cast<const QTitleBar*>(widget); + if (tb) { + ceData.titleBarData.hasWindow = !!(tb->window()); + if (populateReliantFields) { + if (ceData.titleBarData.hasWindow) { + ceData.titleBarData.windowState = (Qt::WindowState)(tb->window()->windowState()); + } + ceData.titleBarData.usesActiveColor = tb->usesActiveColor(); } - ceData.titleBarData.usesActiveColor = tb->usesActiveColor(); + ceData.titleBarData.visibleText = tb->visibleText(); } - ceData.titleBarData.visibleText = tb->visibleText(); } - } - if (ceData.widgetObjectTypes.contains("QSpinWidget")) { - const QSpinWidget *sw = dynamic_cast<const QSpinWidget*>(widget); - if (sw) { - ceData.spinWidgetData.buttonSymbols = sw->buttonSymbols(); - ceData.spinWidgetData.upRect = sw->upRect(); - ceData.spinWidgetData.downRect = sw->downRect(); - ceData.spinWidgetData.upEnabled = sw->isUpEnabled(); - ceData.spinWidgetData.downEnabled = sw->isDownEnabled(); + if (ceData.widgetObjectTypes.contains("QSpinWidget")) { + const QSpinWidget *sw = dynamic_cast<const QSpinWidget*>(widget); + if (sw) { + ceData.spinWidgetData.buttonSymbols = sw->buttonSymbols(); + ceData.spinWidgetData.upRect = sw->upRect(); + ceData.spinWidgetData.downRect = sw->downRect(); + ceData.spinWidgetData.upEnabled = sw->isUpEnabled(); + ceData.spinWidgetData.downEnabled = sw->isDownEnabled(); + } } - } - if (ceData.widgetObjectTypes.contains("QListView")) { - const QListView *lv = dynamic_cast<const QListView*>(widget); - if (lv) { - ceData.listViewData.rootDecorated = lv->rootIsDecorated(); - ceData.listViewData.itemMargin = lv->itemMargin(); - QWidget* viewport = lv->viewport(); - if (viewport) { - ceData.viewportData.widgetObjectTypes = getObjectTypeListForObject(viewport); - ceData.viewportData.allDataPopulated = populateReliantFields; - const QPixmap* erasePixmap = viewport->backgroundPixmap(); - if (erasePixmap) { - ceData.viewportData.bgPixmap = *erasePixmap; + if (ceData.widgetObjectTypes.contains("QListView")) { + const QListView *lv = dynamic_cast<const QListView*>(widget); + if (lv) { + ceData.listViewData.rootDecorated = lv->rootIsDecorated(); + ceData.listViewData.itemMargin = lv->itemMargin(); + QWidget* viewport = lv->viewport(); + if (viewport) { + ceData.viewportData.widgetObjectTypes = getObjectTypeListForObject(viewport); + ceData.viewportData.allDataPopulated = populateReliantFields & populateMinimumNumberOfFields; + const QPixmap* erasePixmap = viewport->backgroundPixmap(); + if (erasePixmap) { + ceData.viewportData.bgPixmap = *erasePixmap; + } + if (populateReliantFields) { + ceData.viewportData.bgBrush = viewport->backgroundBrush(); + } + if (populateReliantFields) { + ceData.viewportData.windowState = (Qt::WindowState)(widget->windowState()); + } + ceData.viewportData.wflags = viewport->getWFlags(); + ceData.viewportData.bgColor = viewport->eraseColor(); + ceData.viewportData.bgOffset = viewport->backgroundOffset(); + ceData.viewportData.backgroundMode = viewport->backgroundMode(); + if (populateReliantFields) { + ceData.viewportData.fgColor = viewport->foregroundColor(); + ceData.viewportData.colorGroup = viewport->colorGroup(); + ceData.viewportData.paletteBgColor = viewport->paletteBackgroundColor(); + } + ceData.viewportData.geometry = viewport->geometry(); + ceData.viewportData.rect = viewport->rect(); + ceData.viewportData.pos = viewport->pos(); + const QPixmap* icon = viewport->icon(); + if (icon) { + ceData.viewportData.icon = *icon; + } + ceData.viewportData.palette = viewport->palette(); + ceData.viewportData.font = viewport->font(); + ceData.viewportData.name = viewport->name(); + ceData.viewportData.caption = viewport->caption(); } - if (populateReliantFields) { - ceData.viewportData.bgBrush = viewport->backgroundBrush(); + } + } + if (ceData.widgetObjectTypes.contains("QComboBox")) { + const QComboBox *cb = dynamic_cast<const QComboBox*>(widget); + if (cb) { + const QLineEdit* lineEdit = cb->lineEdit(); + if (lineEdit) { + ceData.comboBoxLineEditFlags = getControlElementFlagsForObject(lineEdit, ceData.widgetObjectTypes, QStyleOption::Default); } - ceData.viewportData.wflags = viewport->getWFlags(); - if (populateReliantFields) { - ceData.viewportData.windowState = (Qt::WindowState)(widget->windowState()); + const QListBox* listBox = cb->listBox(); + if (listBox) { + ceData.comboBoxListBoxFlags = getControlElementFlagsForObject(listBox, ceData.widgetObjectTypes, QStyleOption::Default); } - ceData.viewportData.bgColor = viewport->eraseColor(); - ceData.viewportData.bgOffset = viewport->backgroundOffset(); - ceData.viewportData.backgroundMode = viewport->backgroundMode(); - if (populateReliantFields) { - ceData.viewportData.fgColor = viewport->foregroundColor(); - ceData.viewportData.colorGroup = viewport->colorGroup(); - ceData.viewportData.paletteBgColor = viewport->paletteBackgroundColor(); + } + } + if (ceData.widgetObjectTypes.contains("QFrame")) { + const QFrame *frame = dynamic_cast<const QFrame*>(widget); + if (frame) { + ceData.frameStyle = frame->frameStyle(); + } + } + + const QWidget* parentWidget = widget->parentWidget(); + if (parentWidget) { + ceData.parentWidgetData.widgetObjectTypes = getObjectTypeListForObject(parentWidget); + ceData.parentWidgetData.allDataPopulated = populateReliantFields & populateMinimumNumberOfFields; + const QPixmap* erasePixmap = parentWidget->backgroundPixmap(); + if (erasePixmap) { + ceData.parentWidgetData.bgPixmap = *erasePixmap; + } + if (populateReliantFields) { + ceData.parentWidgetData.bgBrush = parentWidget->backgroundBrush(); + } + if (populateReliantFields) { + ceData.parentWidgetData.windowState = (Qt::WindowState)(widget->windowState()); + } + ceData.parentWidgetData.wflags = parentWidget->getWFlags(); + ceData.parentWidgetData.bgColor = parentWidget->eraseColor(); + ceData.parentWidgetData.bgOffset = parentWidget->backgroundOffset(); + ceData.parentWidgetData.backgroundMode = parentWidget->backgroundMode(); + if (populateReliantFields) { + ceData.parentWidgetData.fgColor = parentWidget->foregroundColor(); + ceData.parentWidgetData.colorGroup = parentWidget->colorGroup(); + ceData.parentWidgetData.paletteBgColor = parentWidget->paletteBackgroundColor(); + } + ceData.parentWidgetData.geometry = parentWidget->geometry(); + ceData.parentWidgetData.rect = parentWidget->rect(); + ceData.parentWidgetData.pos = parentWidget->pos(); + const QPixmap* icon = parentWidget->icon(); + if (icon) { + ceData.parentWidgetData.icon = *icon; + } + ceData.parentWidgetData.palette = parentWidget->palette(); + ceData.parentWidgetData.font = parentWidget->font(); + ceData.parentWidgetData.name = parentWidget->name(); + ceData.parentWidgetData.caption = parentWidget->caption(); + + const QDockWindow * dw = dynamic_cast<const QDockWindow*>(parentWidget); + if (dw) { + if (dw->area()) { + ceData.dwData.hasDockArea = true; + ceData.dwData.areaOrientation = dw->area()->orientation(); } - ceData.viewportData.geometry = viewport->geometry(); - ceData.viewportData.rect = viewport->rect(); - ceData.viewportData.pos = viewport->pos(); - const QPixmap* icon = viewport->icon(); - if (icon) { - ceData.viewportData.icon = *icon; + else { + ceData.dwData.hasDockArea = false; } - ceData.viewportData.palette = viewport->palette(); - ceData.viewportData.font = viewport->font(); - ceData.viewportData.name = viewport->name(); - ceData.viewportData.caption = viewport->caption(); + ceData.dwData.closeEnabled = dw->isCloseEnabled(); } + const QToolBar * toolbar = dynamic_cast<const QToolBar*>(parentWidget); + if (toolbar) { + ceData.toolBarData.orientation = toolbar->orientation(); + } + ceData.parentWidgetFlags = getControlElementFlagsForObject(parentWidget, ceData.parentWidgetData.widgetObjectTypes, QStyleOption::Default, populateReliantFields); } - } - if (ceData.widgetObjectTypes.contains("QComboBox")) { - const QComboBox *cb = dynamic_cast<const QComboBox*>(widget); - if (cb) { - const QLineEdit* lineEdit = cb->lineEdit(); - if (lineEdit) { - ceData.comboBoxLineEditFlags = getControlElementFlagsForObject(lineEdit, ceData.widgetObjectTypes, QStyleOption::Default); + const QWidget* topLevelWidget = widget->topLevelWidget(); + if (topLevelWidget) { + ceData.topLevelWidgetData.widgetObjectTypes = getObjectTypeListForObject(topLevelWidget); + ceData.topLevelWidgetData.allDataPopulated = populateReliantFields & populateMinimumNumberOfFields; + const QPixmap* erasePixmap = topLevelWidget->backgroundPixmap(); + if (erasePixmap) { + ceData.topLevelWidgetData.bgPixmap = *erasePixmap; } - const QListBox* listBox = cb->listBox(); - if (listBox) { - ceData.comboBoxListBoxFlags = getControlElementFlagsForObject(listBox, ceData.widgetObjectTypes, QStyleOption::Default); + if (populateReliantFields) { + ceData.topLevelWidgetData.bgBrush = topLevelWidget->backgroundBrush(); } - } - } - if (ceData.widgetObjectTypes.contains("QFrame")) { - const QFrame *frame = dynamic_cast<const QFrame*>(widget); - if (frame) { - ceData.frameStyle = frame->frameStyle(); - } - } - - const QWidget* parentWidget = widget->parentWidget(); - if (parentWidget) { - ceData.parentWidgetData.widgetObjectTypes = getObjectTypeListForObject(parentWidget); - ceData.parentWidgetData.allDataPopulated = populateReliantFields; - const QPixmap* erasePixmap = parentWidget->backgroundPixmap(); - if (erasePixmap) { - ceData.parentWidgetData.bgPixmap = *erasePixmap; - } - if (populateReliantFields) { - ceData.parentWidgetData.bgBrush = parentWidget->backgroundBrush(); - } - ceData.parentWidgetData.wflags = parentWidget->getWFlags(); - if (populateReliantFields) { - ceData.parentWidgetData.windowState = (Qt::WindowState)(widget->windowState()); - } - ceData.parentWidgetData.bgColor = parentWidget->eraseColor(); - ceData.parentWidgetData.bgOffset = parentWidget->backgroundOffset(); - ceData.parentWidgetData.backgroundMode = parentWidget->backgroundMode(); - if (populateReliantFields) { - ceData.parentWidgetData.fgColor = parentWidget->foregroundColor(); - ceData.parentWidgetData.colorGroup = parentWidget->colorGroup(); - ceData.parentWidgetData.paletteBgColor = parentWidget->paletteBackgroundColor(); - } - ceData.parentWidgetData.geometry = parentWidget->geometry(); - ceData.parentWidgetData.rect = parentWidget->rect(); - ceData.parentWidgetData.pos = parentWidget->pos(); - const QPixmap* icon = parentWidget->icon(); - if (icon) { - ceData.parentWidgetData.icon = *icon; - } - ceData.parentWidgetData.palette = parentWidget->palette(); - ceData.parentWidgetData.font = parentWidget->font(); - ceData.parentWidgetData.name = parentWidget->name(); - ceData.parentWidgetData.caption = parentWidget->caption(); - - const QDockWindow * dw = dynamic_cast<const QDockWindow*>(parentWidget); - if (dw) { - if (dw->area()) { - ceData.dwData.hasDockArea = true; - ceData.dwData.areaOrientation = dw->area()->orientation(); + if (populateReliantFields) { + ceData.topLevelWidgetData.windowState = (Qt::WindowState)(widget->windowState()); } - else { - ceData.dwData.hasDockArea = false; + ceData.topLevelWidgetData.wflags = topLevelWidget->getWFlags(); + ceData.topLevelWidgetData.bgColor = topLevelWidget->eraseColor(); + ceData.topLevelWidgetData.bgOffset = topLevelWidget->backgroundOffset(); + ceData.topLevelWidgetData.backgroundMode = topLevelWidget->backgroundMode(); + if (populateReliantFields) { + ceData.topLevelWidgetData.fgColor = topLevelWidget->foregroundColor(); + ceData.topLevelWidgetData.colorGroup = topLevelWidget->colorGroup(); + ceData.topLevelWidgetData.paletteBgColor = topLevelWidget->paletteBackgroundColor(); } - ceData.dwData.closeEnabled = dw->isCloseEnabled(); - } - const QToolBar * toolbar = dynamic_cast<const QToolBar*>(parentWidget); - if (toolbar) { - ceData.toolBarData.orientation = toolbar->orientation(); - } - ceData.parentWidgetFlags = getControlElementFlagsForObject(parentWidget, ceData.parentWidgetData.widgetObjectTypes, QStyleOption::Default, populateReliantFields); - } - const QWidget* topLevelWidget = widget->topLevelWidget(); - if (topLevelWidget) { - ceData.topLevelWidgetData.widgetObjectTypes = getObjectTypeListForObject(topLevelWidget); - ceData.topLevelWidgetData.allDataPopulated = populateReliantFields; - const QPixmap* erasePixmap = topLevelWidget->backgroundPixmap(); - if (erasePixmap) { - ceData.topLevelWidgetData.bgPixmap = *erasePixmap; - } - if (populateReliantFields) { - ceData.topLevelWidgetData.bgBrush = topLevelWidget->backgroundBrush(); - } - ceData.topLevelWidgetData.wflags = topLevelWidget->getWFlags(); - if (populateReliantFields) { - ceData.topLevelWidgetData.windowState = (Qt::WindowState)(widget->windowState()); - } - ceData.topLevelWidgetData.bgColor = topLevelWidget->eraseColor(); - ceData.topLevelWidgetData.bgOffset = topLevelWidget->backgroundOffset(); - ceData.topLevelWidgetData.backgroundMode = topLevelWidget->backgroundMode(); - if (populateReliantFields) { - ceData.topLevelWidgetData.fgColor = topLevelWidget->foregroundColor(); - ceData.topLevelWidgetData.colorGroup = topLevelWidget->colorGroup(); - ceData.topLevelWidgetData.paletteBgColor = topLevelWidget->paletteBackgroundColor(); - } - ceData.topLevelWidgetData.geometry = topLevelWidget->geometry(); - ceData.topLevelWidgetData.rect = topLevelWidget->rect(); - ceData.topLevelWidgetData.pos = topLevelWidget->pos(); - const QPixmap* icon = topLevelWidget->icon(); - if (icon) { - ceData.topLevelWidgetData.icon = *icon; - } - ceData.topLevelWidgetData.palette = topLevelWidget->palette(); - ceData.topLevelWidgetData.font = topLevelWidget->font(); - ceData.topLevelWidgetData.name = topLevelWidget->name(); - ceData.topLevelWidgetData.caption = topLevelWidget->caption(); - - const QDockWindow * dw = dynamic_cast<const QDockWindow*>(topLevelWidget); - if (dw) { - if (dw->area()) { - ceData.dwData.hasDockArea = true; - ceData.dwData.areaOrientation = dw->area()->orientation(); + ceData.topLevelWidgetData.geometry = topLevelWidget->geometry(); + ceData.topLevelWidgetData.rect = topLevelWidget->rect(); + ceData.topLevelWidgetData.pos = topLevelWidget->pos(); + const QPixmap* icon = topLevelWidget->icon(); + if (icon) { + ceData.topLevelWidgetData.icon = *icon; } - else { - ceData.dwData.hasDockArea = false; + ceData.topLevelWidgetData.palette = topLevelWidget->palette(); + ceData.topLevelWidgetData.font = topLevelWidget->font(); + ceData.topLevelWidgetData.name = topLevelWidget->name(); + ceData.topLevelWidgetData.caption = topLevelWidget->caption(); + + const QDockWindow * dw = dynamic_cast<const QDockWindow*>(topLevelWidget); + if (dw) { + if (dw->area()) { + ceData.dwData.hasDockArea = true; + ceData.dwData.areaOrientation = dw->area()->orientation(); + } + else { + ceData.dwData.hasDockArea = false; + } + ceData.dwData.closeEnabled = dw->isCloseEnabled(); + } + const QToolBar * toolbar = dynamic_cast<const QToolBar*>(topLevelWidget); + if (toolbar) { + ceData.toolBarData.orientation = toolbar->orientation(); } - ceData.dwData.closeEnabled = dw->isCloseEnabled(); + ceData.topLevelWidgetFlags = getControlElementFlagsForObject(topLevelWidget, ceData.topLevelWidgetData.widgetObjectTypes, QStyleOption::Default, populateReliantFields); } - const QToolBar * toolbar = dynamic_cast<const QToolBar*>(topLevelWidget); - if (toolbar) { - ceData.toolBarData.orientation = toolbar->orientation(); + + QCheckListItem *item = opt.checkListItem(); + if (item) { + ceData.checkListItemData.dataValid = true; + ceData.checkListItemData.enabled = item->isEnabled(); + ceData.checkListItemData.hasParent = ( item->parent() && (item->parent()->rtti() == 1) && (((QCheckListItem*) item->parent())->type() == QCheckListItem::Controller) ); + ceData.checkListItemData.height = item->height(); + } + else { + ceData.checkListItemData.dataValid = false; } - ceData.topLevelWidgetFlags = getControlElementFlagsForObject(topLevelWidget, ceData.topLevelWidgetData.widgetObjectTypes, QStyleOption::Default, populateReliantFields); - } - - QCheckListItem *item = opt.checkListItem(); - if (item) { - ceData.checkListItemData.dataValid = true; - ceData.checkListItemData.enabled = item->isEnabled(); - ceData.checkListItemData.hasParent = ( item->parent() && (item->parent()->rtti() == 1) && (((QCheckListItem*) item->parent())->type() == QCheckListItem::Controller) ); - ceData.checkListItemData.height = item->height(); - } - else { - ceData.checkListItemData.dataValid = false; } } @@ -687,7 +696,7 @@ QStyleControlElementData populateControlElementDataFromApplication(const QApplic /*! \reimp */ void QCommonStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1165,7 +1174,7 @@ void qt_style_erase_region(QPainter* p, const QRegion& region, QStyleControlElem /*! \reimp */ void QCommonStyle::drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1611,7 +1620,7 @@ void QCommonStyle::drawControl( ControlElement element, { QRect rect = r; - QIconSet* icon = &ceData.iconSet; + const QIconSet* icon = &ceData.iconSet; if ( icon ) { QPixmap pixmap = icon->pixmap( QIconSet::Small, flags & Style_Enabled ? @@ -1645,7 +1654,7 @@ void QCommonStyle::drawControl( ControlElement element, /*! \reimp */ void QCommonStyle::drawControlMask( ControlElement control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QStyleOption& opt, @@ -1681,7 +1690,7 @@ void QCommonStyle::drawControlMask( ControlElement control, } /*! \reimp */ -QRect QCommonStyle::subRect(SubRect r, const QStyleControlElementData ceData, const ControlElementFlags elementFlags, const QWidget *widget) const +QRect QCommonStyle::subRect(SubRect r, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QWidget *widget) const { QRect rect, wrect(ceData.rect); @@ -1977,7 +1986,7 @@ QRect QCommonStyle::subRect(SubRect r, const QStyleControlElementData ceData, co /* I really need this and I don't want to expose it in QRangeControl.. */ -static int qPositionFromValue( QStyleControlElementData ceData, int logical_val, +static int qPositionFromValue( const QStyleControlElementData &ceData, int logical_val, int span ) { if ( span <= 0 || logical_val < ceData.minSteps || @@ -2010,7 +2019,7 @@ static int qPositionFromValue( QStyleControlElementData ceData, int logical_val, /*! \reimp */ void QCommonStyle::drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -2412,7 +2421,7 @@ void QCommonStyle::drawComplexControl( ComplexControl control, /*! \reimp */ void QCommonStyle::drawComplexControlMask( ComplexControl control, QPainter *p, - const QStyleControlElementData ceData, + const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QRect &r, const QStyleOption& opt, @@ -2429,7 +2438,7 @@ void QCommonStyle::drawComplexControlMask( ComplexControl control, /*! \reimp */ QRect QCommonStyle::querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const QStyleOption &opt, @@ -2663,7 +2672,7 @@ QRect QCommonStyle::querySubControlMetrics( ComplexControl control, /*! \reimp */ QStyle::SubControl QCommonStyle::querySubControl(ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QPoint &pos, const QStyleOption& opt, @@ -2738,7 +2747,7 @@ QStyle::SubControl QCommonStyle::querySubControl(ComplexControl control, } /*! \reimp */ -int QCommonStyle::pixelMetric(PixelMetric m, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget) const +int QCommonStyle::pixelMetric(PixelMetric m, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget) const { int ret; @@ -2962,7 +2971,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, QStyleControlElementData ceData, Co /*! \reimp */ QSize QCommonStyle::sizeFromContents(ContentsType contents, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& opt, @@ -3132,7 +3141,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType contents, } /*! \reimp */ -int QCommonStyle::styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption &, QStyleHintReturn *, const QWidget * w) const +int QCommonStyle::styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &, QStyleHintReturn *, const QWidget * w) const { Q_UNUSED(w); @@ -3215,7 +3224,7 @@ int QCommonStyle::styleHint(StyleHint sh, QStyleControlElementData ceData, Contr } /*! \reimp */ -QPixmap QCommonStyle::stylePixmap(StylePixmap, QStyleControlElementData, ControlElementFlags, const QStyleOption&, const QWidget *) const +QPixmap QCommonStyle::stylePixmap(StylePixmap, const QStyleControlElementData&, ControlElementFlags, const QStyleOption&, const QWidget *) const { return QPixmap(); } diff --git a/src/styles/qcommonstyle.h b/src/styles/qcommonstyle.h index c445740..114822a 100644 --- a/src/styles/qcommonstyle.h +++ b/src/styles/qcommonstyle.h @@ -58,7 +58,7 @@ public: // New API void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -68,7 +68,7 @@ public: // New API void drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -79,19 +79,19 @@ public: // New API void drawControlMask( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; // New API - QRect subRect( SubRect r, const QStyleControlElementData ceData, const ControlElementFlags elementFlags, const QWidget *widget ) const; + QRect subRect( SubRect r, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QWidget *widget ) const; // New API void drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -108,7 +108,7 @@ public: // New API void drawComplexControlMask( ComplexControl control, QPainter *p, - const QStyleControlElementData ceData, + const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QRect &r, const QStyleOption& = QStyleOption::Default, @@ -116,7 +116,7 @@ public: // New API QRect querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const QStyleOption& = QStyleOption::Default, @@ -124,29 +124,29 @@ public: // New API SubControl querySubControl( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QPoint &pos, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; // New API - int pixelMetric( PixelMetric m, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; + int pixelMetric( PixelMetric m, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; // New API QSize sizeFromContents( ContentsType s, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; // New API - int styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption &, QStyleHintReturn *, const QWidget * w) const; + int styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &, QStyleHintReturn *, const QWidget * w) const; // New API QPixmap stylePixmap( StylePixmap sp, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; diff --git a/src/styles/qcompactstyle.cpp b/src/styles/qcompactstyle.cpp index 63c5be5..e3236f2 100644 --- a/src/styles/qcompactstyle.cpp +++ b/src/styles/qcompactstyle.cpp @@ -55,7 +55,7 @@ QCompactStyle::QCompactStyle() } /*! \reimp */ -int QCompactStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) +int QCompactStyle::pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) { int ret; switch ( metric ) { @@ -151,7 +151,7 @@ void drawPopupMenuItem( QPainter*, bool, } /*! \reimp */ -void QCompactStyle::drawControl( ControlElement element, QPainter *p, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QRect &r, +void QCompactStyle::drawControl( ControlElement element, QPainter *p, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &g, SFlags flags, const QStyleOption& opt, const QWidget *widget ) { switch ( element ) { @@ -312,7 +312,7 @@ void QCompactStyle::drawControl( ControlElement element, QPainter *p, QStyleCont /*! \reimp */ void QCompactStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -368,7 +368,7 @@ void QCompactStyle::drawPrimitive( PrimitiveElement pe, } /*! \reimp */ -int QCompactStyle::styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption &opt, QStyleHintReturn *returnData, const QWidget *w) const +int QCompactStyle::styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &opt, QStyleHintReturn *returnData, const QWidget *w) const { int ret; diff --git a/src/styles/qcompactstyle.h b/src/styles/qcompactstyle.h index 6002055..682411d 100644 --- a/src/styles/qcompactstyle.h +++ b/src/styles/qcompactstyle.h @@ -58,21 +58,21 @@ class Q_EXPORT_STYLE_COMPACT QCompactStyle : public QWindowsStyle public: QCompactStyle(); - int pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ); + int pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ); void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags flags = Style_Default, const QStyleOption& = QStyleOption::Default ) const; - void drawControl( ControlElement element, QPainter *p, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QRect &r, + void drawControl( ControlElement element, QPainter *p, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags how = Style_Default, const QStyleOption& = QStyleOption::Default, const QWidget *w = 0 ); - int styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption &, QStyleHintReturn *, const QWidget *) const; + int styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &, QStyleHintReturn *, const QWidget *) const; private: // Disabled copy constructor and operator= #if defined(Q_DISABLE_COPY) diff --git a/src/styles/qmotifplusstyle.cpp b/src/styles/qmotifplusstyle.cpp index 113716c..34dc7fa 100644 --- a/src/styles/qmotifplusstyle.cpp +++ b/src/styles/qmotifplusstyle.cpp @@ -175,7 +175,7 @@ void QMotifPlusStyle::polish(QPalette &) /*! \reimp */ -void QMotifPlusStyle::polish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr) +void QMotifPlusStyle::polish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) { if (ceData.widgetObjectTypes.contains("QWidget")) { #ifndef QT_NO_FRAME @@ -212,7 +212,7 @@ void QMotifPlusStyle::polish(QStyleControlElementData ceData, ControlElementFlag /*! \reimp */ -void QMotifPlusStyle::unPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr) +void QMotifPlusStyle::unPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) { removeObjectEventHandler(ceData, elementFlags, ptr, this); QMotifStyle::unPolish(ceData, elementFlags, ptr); @@ -220,19 +220,19 @@ void QMotifPlusStyle::unPolish(QStyleControlElementData ceData, ControlElementFl /*! \reimp */ -void QMotifPlusStyle::applicationPolish(QStyleControlElementData, ControlElementFlags, void *) +void QMotifPlusStyle::applicationPolish(const QStyleControlElementData&, ControlElementFlags, void *) { } /*! \reimp */ -void QMotifPlusStyle::applicationUnPolish(QStyleControlElementData, ControlElementFlags, void *) +void QMotifPlusStyle::applicationUnPolish(const QStyleControlElementData&, ControlElementFlags, void *) { } /*! \reimp */ -int QMotifPlusStyle::pixelMetric(PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget) const +int QMotifPlusStyle::pixelMetric(PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget) const { int ret; @@ -282,7 +282,7 @@ int QMotifPlusStyle::pixelMetric(PixelMetric metric, QStyleControlElementData ce /*! \reimp */ void QMotifPlusStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -700,7 +700,7 @@ void QMotifPlusStyle::drawPrimitive( PrimitiveElement pe, */ void QMotifPlusStyle::drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1047,7 +1047,7 @@ void QMotifPlusStyle::drawControl( ControlElement element, /*! \reimp */ -QRect QMotifPlusStyle::subRect(SubRect r, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget) const +QRect QMotifPlusStyle::subRect(SubRect r, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget) const { QRect rect; @@ -1136,7 +1136,7 @@ QRect QMotifPlusStyle::subRect(SubRect r, QStyleControlElementData ceData, Contr /*! \reimp */ void QMotifPlusStyle::drawComplexControl(ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1426,7 +1426,7 @@ void QMotifPlusStyle::drawComplexControl(ComplexControl control, /*! \reimp */ QRect QMotifPlusStyle::querySubControlMetrics(ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl subcontrol, const QStyleOption& opt, @@ -1524,7 +1524,7 @@ QRect QMotifPlusStyle::querySubControlMetrics(ComplexControl control, /*! \reimp */ -bool QMotifPlusStyle::objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *event ) +bool QMotifPlusStyle::objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *event ) { switch(event->type()) { case QEvent::MouseButtonPress: @@ -1596,7 +1596,7 @@ bool QMotifPlusStyle::objectEventHandler( QStyleControlElementData ceData, Contr /*! \reimp */ int QMotifPlusStyle::styleHint(StyleHint hint, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &opt, QStyleHintReturn *returnData, diff --git a/src/styles/qmotifplusstyle.h b/src/styles/qmotifplusstyle.h index 24de609..cf49425 100644 --- a/src/styles/qmotifplusstyle.h +++ b/src/styles/qmotifplusstyle.h @@ -63,15 +63,15 @@ public: virtual ~QMotifPlusStyle(); void polish(QPalette &pal); - void polish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *); - void unPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *); + void polish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *); + void unPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *); - void applicationPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *); - void applicationUnPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *); + void applicationPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *); + void applicationUnPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *); void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -80,7 +80,7 @@ public: void drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -88,11 +88,11 @@ public: const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; - QRect subRect(SubRect r, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget) const; + QRect subRect(SubRect r, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget) const; void drawComplexControl(ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -107,18 +107,18 @@ public: const QWidget *widget = 0 ) const; QRect querySubControlMetrics(ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl subcontrol, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0) const; - int pixelMetric(PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget = 0) const; + int pixelMetric(PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0) const; - int styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption & = QStyleOption::Default, + int styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption & = QStyleOption::Default, QStyleHintReturn* = 0, const QWidget * = 0) const; - bool objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); + bool objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); private: diff --git a/src/styles/qmotifstyle.cpp b/src/styles/qmotifstyle.cpp index 826cd16..e7b3fc6 100644 --- a/src/styles/qmotifstyle.cpp +++ b/src/styles/qmotifstyle.cpp @@ -171,7 +171,7 @@ void QMotifStyle::polish( QPalette& pal ) \internal Keep QStyle::polish() visible. */ -void QMotifStyle::polish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) +void QMotifStyle::polish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { QStyle::polish(ceData, elementFlags, ptr); } @@ -181,7 +181,7 @@ void QMotifStyle::polish( QStyleControlElementData ceData, ControlElementFlags e \internal Keep QStyle::polish() visible. */ -void QMotifStyle::applicationPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) +void QMotifStyle::applicationPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { QStyle::applicationPolish(ceData, elementFlags, ptr); } @@ -204,7 +204,7 @@ static void rot(QPointArray& a, int n) */ void QMotifStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -821,7 +821,7 @@ void QMotifStyle::drawPrimitive( PrimitiveElement pe, */ void QMotifStyle::drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1257,7 +1257,7 @@ static void get_combo_parameters( const QRect &r, */ void QMotifStyle::drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1500,7 +1500,7 @@ void QMotifStyle::drawComplexControl( ComplexControl control, /*! \reimp */ -int QMotifStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const +int QMotifStyle::pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const { int ret; @@ -1595,7 +1595,7 @@ int QMotifStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceDat /*!\reimp */ QRect QMotifStyle::querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const QStyleOption& opt, @@ -1766,7 +1766,7 @@ QRect QMotifStyle::querySubControlMetrics( ComplexControl control, /*!\reimp */ QSize QMotifStyle::sizeFromContents( ContentsType contents, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& opt, @@ -1846,7 +1846,7 @@ QSize QMotifStyle::sizeFromContents( ContentsType contents, /*!\reimp */ -QRect QMotifStyle::subRect( SubRect r, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const +QRect QMotifStyle::subRect( SubRect r, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const { QRect rect; QRect wrect = ceData.rect; @@ -1953,7 +1953,7 @@ QRect QMotifStyle::subRect( SubRect r, QStyleControlElementData ceData, ControlE /*! \reimp */ -void QMotifStyle::polishPopupMenu( QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) +void QMotifStyle::polishPopupMenu( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { #ifndef QT_NO_POPUPMENU if ( !(ceData.windowState & WState_Polished ) ) { @@ -2269,7 +2269,7 @@ static const char *const question_xpm[] = { \reimp */ QPixmap QMotifStyle::stylePixmap(StylePixmap sp, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption& opt, const QWidget *widget) const @@ -2355,7 +2355,7 @@ QPixmap QMotifStyle::stylePixmap(StylePixmap sp, /*! \reimp */ int QMotifStyle::styleHint(StyleHint hint, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &opt, QStyleHintReturn *returnData, diff --git a/src/styles/qmotifstyle.h b/src/styles/qmotifstyle.h index 31ec525..31541f6 100644 --- a/src/styles/qmotifstyle.h +++ b/src/styles/qmotifstyle.h @@ -67,15 +67,15 @@ public: bool useHighlightColors() const; void polish( QPalette& ); - void polish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); - void applicationPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + void polish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); + void applicationPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); - void polishPopupMenu( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + void polishPopupMenu( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); // new style API void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -84,7 +84,7 @@ public: void drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -94,7 +94,7 @@ public: void drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect& r, const QColorGroup& cg, @@ -109,26 +109,26 @@ public: const QWidget* widget = 0 ) const; QRect querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; - int pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; + int pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; QSize sizeFromContents( ContentsType contents, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; - QRect subRect( SubRect r, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const; + QRect subRect( SubRect r, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const; - QPixmap stylePixmap(StylePixmap, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption& = QStyleOption::Default, const QWidget * = 0) const; + QPixmap stylePixmap(StylePixmap, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption& = QStyleOption::Default, const QWidget * = 0) const; - int styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption & = QStyleOption::Default, + int styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption & = QStyleOption::Default, QStyleHintReturn* = 0, const QWidget * = 0) const; private: diff --git a/src/styles/qplatinumstyle.cpp b/src/styles/qplatinumstyle.cpp index ff583e0..0cf5d11 100644 --- a/src/styles/qplatinumstyle.cpp +++ b/src/styles/qplatinumstyle.cpp @@ -86,7 +86,7 @@ QPlatinumStyle::~QPlatinumStyle() */ void QPlatinumStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -742,7 +742,7 @@ void QPlatinumStyle::drawPrimitive( PrimitiveElement pe, */ void QPlatinumStyle::drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -932,7 +932,7 @@ void QPlatinumStyle::drawControl( ControlElement element, */ void QPlatinumStyle::drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1320,7 +1320,7 @@ void QPlatinumStyle::drawComplexControl( ComplexControl control, /*!\reimp */ QRect QPlatinumStyle::querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const QStyleOption& opt, @@ -1432,7 +1432,7 @@ QRect QPlatinumStyle::querySubControlMetrics( ComplexControl control, /*!\reimp */ -int QPlatinumStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, +int QPlatinumStyle::pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const { int ret; @@ -1469,7 +1469,7 @@ int QPlatinumStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ce /*!\reimp */ -QRect QPlatinumStyle::subRect( SubRect r, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const +QRect QPlatinumStyle::subRect( SubRect r, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const { QRect rect; switch ( r ) { diff --git a/src/styles/qplatinumstyle.h b/src/styles/qplatinumstyle.h index 6bf409f..13cc866 100644 --- a/src/styles/qplatinumstyle.h +++ b/src/styles/qplatinumstyle.h @@ -65,7 +65,7 @@ public: // new Style Stuff void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -74,7 +74,7 @@ public: void drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -84,7 +84,7 @@ public: void drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -99,15 +99,15 @@ public: const QWidget *widget = 0 ) const; QRect querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; - int pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; + int pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; - QRect subRect( SubRect r, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const; + QRect subRect( SubRect r, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const; protected: QColor mixedColor(const QColor &, const QColor &) const; diff --git a/src/styles/qsgistyle.cpp b/src/styles/qsgistyle.cpp index eb59d11..1728f69 100644 --- a/src/styles/qsgistyle.cpp +++ b/src/styles/qsgistyle.cpp @@ -136,7 +136,7 @@ QSGIStyle::~QSGIStyle() bold italic font for menu options. */ void -QSGIStyle::applicationPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) +QSGIStyle::applicationPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { isApplicationStyle = 1; QMotifStyle::polish( ceData, elementFlags, ptr ); @@ -181,7 +181,7 @@ QSGIStyle::applicationPolish( QStyleControlElementData ceData, ControlElementFla /*! \reimp */ void -QSGIStyle::applicationUnPolish( QStyleControlElementData, ControlElementFlags, void * ) +QSGIStyle::applicationUnPolish( const QStyleControlElementData&, ControlElementFlags, void * ) { QFont f = QApplication::font(); QApplication::setFont( f, TRUE ); // get rid of the special fonts for special widget classes @@ -194,7 +194,7 @@ QSGIStyle::applicationUnPolish( QStyleControlElementData, ControlElementFlags, v hovering. */ void -QSGIStyle::polish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) +QSGIStyle::polish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { QMotifStyle::polish(ceData, elementFlags, ptr); @@ -269,7 +269,7 @@ QSGIStyle::polish( QStyleControlElementData ceData, ControlElementFlags elementF /*! \reimp */ void -QSGIStyle::unPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) +QSGIStyle::unPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { if ( (ceData.widgetObjectTypes.contains("QButton")) || (ceData.widgetObjectTypes.contains("QSlider")) || (ceData.widgetObjectTypes.contains("QScrollBar")) ) { removeObjectEventHandler(ceData, elementFlags, ptr, this); @@ -286,7 +286,7 @@ QSGIStyle::unPolish( QStyleControlElementData ceData, ControlElementFlags elemen } /*! \reimp */ -bool QSGIStyle::objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) +bool QSGIStyle::objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) { if ( (!(ceData.widgetObjectTypes.contains("QWidget"))) || (e->type() == QEvent::Paint) ) return QMotifStyle::objectEventHandler( ceData, elementFlags, source, e ); @@ -375,7 +375,7 @@ static const int sgiTabSpacing = 12; // space between text and tab static const int sgiCheckMarkSpace = 20; /*! \reimp */ -int QSGIStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const +int QSGIStyle::pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const { switch ( metric ) { case PM_DefaultFrameWidth: @@ -560,7 +560,7 @@ static void get_combo_parameters( const QRect &r, /*! \reimp */ void QSGIStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -943,7 +943,7 @@ void QSGIStyle::drawPrimitive( PrimitiveElement pe, /*! \reimp */ void QSGIStyle::drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1186,7 +1186,7 @@ void QSGIStyle::drawControl( ControlElement element, /*! \reimp */ void QSGIStyle::drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect& r, const QColorGroup& cg, @@ -1407,7 +1407,7 @@ void QSGIStyle::drawComplexControl( ComplexControl control, /*!\reimp */ QSize QSGIStyle::sizeFromContents( ContentsType contents, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& opt, @@ -1447,7 +1447,7 @@ QSize QSGIStyle::sizeFromContents( ContentsType contents, } /*! \reimp */ -QRect QSGIStyle::subRect( SubRect r, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const +QRect QSGIStyle::subRect( SubRect r, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const { QRect rect; @@ -1472,7 +1472,7 @@ QRect QSGIStyle::subRect( SubRect r, QStyleControlElementData ceData, ControlEle /*! \reimp */ QRect QSGIStyle::querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sub, const QStyleOption& opt, @@ -1512,7 +1512,7 @@ QRect QSGIStyle::querySubControlMetrics( ComplexControl control, } /*! \reimp */ -int QSGIStyle::styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption &opt, QStyleHintReturn *returnData, const QWidget *w) const +int QSGIStyle::styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &opt, QStyleHintReturn *returnData, const QWidget *w) const { int ret; diff --git a/src/styles/qsgistyle.h b/src/styles/qsgistyle.h index 17bdb05..2e91d3a 100644 --- a/src/styles/qsgistyle.h +++ b/src/styles/qsgistyle.h @@ -67,14 +67,14 @@ public: #if !defined(Q_NO_USING_KEYWORD) using QMotifStyle::polish; #endif - void polish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); - void unPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); - void applicationPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); - void applicationUnPolish( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + void polish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); + void unPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); + void applicationPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); + void applicationUnPolish( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -83,7 +83,7 @@ public: void drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -93,7 +93,7 @@ public: void drawComplexControl( ComplexControl control, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect& r, const QColorGroup& cg, @@ -107,26 +107,26 @@ public: const QStyleOption& = QStyleOption::Default, const QWidget* widget = 0 ) const; - int pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; + int pixelMetric( PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; QSize sizeFromContents( ContentsType contents, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; - QRect subRect( SubRect r, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const; + QRect subRect( SubRect r, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget ) const; QRect querySubControlMetrics( ComplexControl control, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; - int styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption &, QStyleHintReturn *, const QWidget *) const; + int styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &, QStyleHintReturn *, const QWidget *) const; - bool objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); + bool objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); private: QSGIStylePrivate *d; diff --git a/src/styles/qwindowsstyle.cpp b/src/styles/qwindowsstyle.cpp index f93e31a..4920f61 100644 --- a/src/styles/qwindowsstyle.cpp +++ b/src/styles/qwindowsstyle.cpp @@ -95,7 +95,7 @@ class QWindowsStyle::Private : public QObject public: Private(QWindowsStyle *parent); - bool objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); + bool objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); private: int menuBarTimer; @@ -107,7 +107,7 @@ QWindowsStyle::Private::Private(QWindowsStyle *parent) } // Records Alt- and Focus events -bool QWindowsStyle::Private::objectEventHandler( QStyleControlElementData ceData, ControlElementFlags, void* source, QEvent *e ) +bool QWindowsStyle::Private::objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags, void* source, QEvent *e ) { if (!(ceData.widgetObjectTypes.contains("QWidget"))) { return TRUE; @@ -173,7 +173,7 @@ QWindowsStyle::~QWindowsStyle() } /*! \reimp */ -bool QWindowsStyle::objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) { +bool QWindowsStyle::objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ) { if (d) { return d->objectEventHandler(ceData, elementFlags, source, e); } @@ -181,7 +181,7 @@ bool QWindowsStyle::objectEventHandler( QStyleControlElementData ceData, Control } /*! \reimp */ -void QWindowsStyle::applicationPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr) +void QWindowsStyle::applicationPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) { // We only need the overhead when shortcuts are sometimes hidden if (styleHint(SH_UnderlineAccelerator, QStyleControlElementData(), CEF_None, 0) && styleHint(SH_HideUnderlineAcceleratorWhenAltUp, QStyleControlElementData(), CEF_None, 0)) { @@ -191,20 +191,20 @@ void QWindowsStyle::applicationPolish(QStyleControlElementData ceData, ControlEl } /*! \reimp */ -void QWindowsStyle::applicationUnPolish(QStyleControlElementData, ControlElementFlags, void *) +void QWindowsStyle::applicationUnPolish(const QStyleControlElementData&, ControlElementFlags, void *) { delete d; d = 0; } /*! \reimp */ -void QWindowsStyle::polish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr) +void QWindowsStyle::polish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) { QCommonStyle::polish(ceData, elementFlags, ptr); } /*! \reimp */ -void QWindowsStyle::unPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr) +void QWindowsStyle::unPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) { QCommonStyle::polish(ceData, elementFlags, ptr); } @@ -218,7 +218,7 @@ void QWindowsStyle::polish( QPalette &pal ) /*! \reimp */ void QWindowsStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -688,7 +688,7 @@ void QWindowsStyle::drawPrimitive( PrimitiveElement pe, */ void QWindowsStyle::drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1019,7 +1019,7 @@ void QWindowsStyle::drawControl( ControlElement element, /*! \reimp */ -int QWindowsStyle::pixelMetric(PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget) const +int QWindowsStyle::pixelMetric(PixelMetric metric, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget) const { int ret; @@ -1096,7 +1096,7 @@ int QWindowsStyle::pixelMetric(PixelMetric metric, QStyleControlElementData ceDa \reimp */ QSize QWindowsStyle::sizeFromContents( ContentsType contents, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& opt, @@ -1196,7 +1196,7 @@ QSize QWindowsStyle::sizeFromContents( ContentsType contents, /*! \reimp */ -void QWindowsStyle::polishPopupMenu( QStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) +void QWindowsStyle::polishPopupMenu( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { #ifndef QT_NO_POPUPMENU if ( !(ceData.windowState & WState_Polished ) ) { @@ -1488,7 +1488,7 @@ static const char *const question_xpm[] = { \reimp */ QPixmap QWindowsStyle::stylePixmap(StylePixmap stylepixmap, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption& opt, const QWidget *widget) const @@ -1527,7 +1527,7 @@ QPixmap QWindowsStyle::stylePixmap(StylePixmap stylepixmap, /*!\reimp */ void QWindowsStyle::drawComplexControl( ComplexControl ctrl, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -1975,7 +1975,7 @@ void QWindowsStyle::drawComplexControl( ComplexControl ctrl, QPainter *p, /*! \reimp */ int QWindowsStyle::styleHint( StyleHint hint, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption &opt, QStyleHintReturn *returnData, @@ -2032,7 +2032,7 @@ int QWindowsStyle::styleHint( StyleHint hint, } /*! \reimp */ -QRect QWindowsStyle::subRect(SubRect r, const QStyleControlElementData ceData, const ControlElementFlags elementFlags, const QWidget *widget) const +QRect QWindowsStyle::subRect(SubRect r, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QWidget *widget) const { QRect rect; diff --git a/src/styles/qwindowsstyle.h b/src/styles/qwindowsstyle.h index 4ffc849..2cb3283 100644 --- a/src/styles/qwindowsstyle.h +++ b/src/styles/qwindowsstyle.h @@ -61,20 +61,20 @@ public: QWindowsStyle(); ~QWindowsStyle(); - void applicationPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *); - void applicationUnPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *); + void applicationPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *); + void applicationUnPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *); - void polish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *); - void unPolish(QStyleControlElementData ceData, ControlElementFlags elementFlags, void *); + void polish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *); + void unPolish(const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void *); void polish( QPalette & ); - virtual void polishPopupMenu( QStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void polishPopupMenu( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); // new stuff void drawPrimitive( PrimitiveElement pe, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -83,7 +83,7 @@ public: void drawControl( ControlElement element, QPainter *p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, @@ -93,7 +93,7 @@ public: void drawComplexControl( ComplexControl control, QPainter* p, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QRect& r, const QColorGroup& cg, @@ -108,29 +108,29 @@ public: const QWidget* widget = 0 ) const; int pixelMetric( PixelMetric metric, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QWidget *widget = 0 ) const; QSize sizeFromContents( ContentsType contents, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QSize &contentsSize, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; - int styleHint(StyleHint sh, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QStyleOption & = QStyleOption::Default, + int styleHint(StyleHint sh, const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption & = QStyleOption::Default, QStyleHintReturn* = 0, const QWidget* = 0) const; QPixmap stylePixmap( StylePixmap stylepixmap, - QStyleControlElementData ceData, + const QStyleControlElementData &ceData, ControlElementFlags elementFlags, const QStyleOption& = QStyleOption::Default, const QWidget *widget = 0 ) const; - QRect subRect( SubRect r, const QStyleControlElementData ceData, const ControlElementFlags elementFlags, const QWidget *widget ) const; + QRect subRect( SubRect r, const QStyleControlElementData &ceData, const ControlElementFlags elementFlags, const QWidget *widget ) const; - bool objectEventHandler( QStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); + bool objectEventHandler( const QStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, QEvent *e ); private: class Private; |