diff options
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/ntqstyle.h | 76 | ||||
-rw-r--r-- | src/kernel/ntqwidget.h | 2 | ||||
-rw-r--r-- | src/kernel/qstyle.cpp | 88 | ||||
-rw-r--r-- | src/kernel/qwidget.cpp | 13 |
4 files changed, 98 insertions, 81 deletions
diff --git a/src/kernel/ntqstyle.h b/src/kernel/ntqstyle.h index 3e59bc027..bee3bd207 100644 --- a/src/kernel/ntqstyle.h +++ b/src/kernel/ntqstyle.h @@ -228,6 +228,10 @@ class TQStyleControlElementTabBarData { class Q_EXPORT TQStyleControlElementData { public: + TQStyleControlElementData(); + + public: + bool isNull; TQStringList widgetObjectTypes; bool allDataPopulated; TQt::WFlags wflags; @@ -286,9 +290,6 @@ class Q_EXPORT TQStyleControlElementData { TQString caption; TQStyleControlElementGenericWidgetData topLevelWidgetData; TQ_UINT32 topLevelWidgetFlags; - - public: - TQStyleControlElementData(); }; class Q_EXPORT TQStyleWidgetActionRequestData { @@ -360,28 +361,28 @@ public: virtual void polish( TQWidget * ); // New API - virtual void polish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void polish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); // Old API // DEPRECATED virtual void unPolish( TQWidget * ); // New API - virtual void unPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void unPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); // Old API // DEPRECATED virtual void polish( TQApplication * ); // New API - virtual void applicationPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void applicationPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); // Old API // DEPRECATED virtual void unPolish( TQApplication * ); // New API - virtual void applicationUnPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); + virtual void applicationUnPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); virtual void polish( TQPalette & ); @@ -390,7 +391,7 @@ public: virtual void polishPopupMenu( TQPopupMenu* ); // New API - virtual void polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ) = 0; + virtual void polishPopupMenu( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ) = 0; virtual TQRect itemRect( TQPainter *p, const TQRect &r, int flags, bool enabled, @@ -521,7 +522,7 @@ public: // New API virtual void drawPrimitive( PrimitiveElement pe, TQPainter *p, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, @@ -576,7 +577,7 @@ public: // New API virtual void drawControl( ControlElement element, TQPainter *p, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, @@ -595,7 +596,7 @@ public: // New API virtual void drawControlMask( ControlElement element, TQPainter *p, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQStyleOption& = TQStyleOption::Default, @@ -646,7 +647,7 @@ public: virtual TQRect subRect( SubRect r, const TQWidget *widget ) const; // New API - virtual TQRect subRect( SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget ) const = 0; + virtual TQRect subRect( SubRect r, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQWidget *widget ) const = 0; enum ComplexControl{ @@ -728,7 +729,7 @@ public: virtual void drawComplexControl( ComplexControl control, TQPainter *p, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, @@ -753,7 +754,7 @@ public: // New API virtual void drawComplexControlMask( ComplexControl control, TQPainter *p, - const TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQRect &r, const TQStyleOption& = TQStyleOption::Default, @@ -768,7 +769,7 @@ public: // New API virtual TQRect querySubControlMetrics( ComplexControl control, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const TQStyleOption& = TQStyleOption::Default, @@ -783,7 +784,7 @@ public: // New API virtual SubControl querySubControl( ComplexControl control, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQPoint &pos, const TQStyleOption& = TQStyleOption::Default, @@ -872,7 +873,7 @@ public: // New API virtual int pixelMetric( PixelMetric metric, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget *widget = 0 ) const = 0; @@ -909,7 +910,7 @@ public: const TQStyleOption& = TQStyleOption::Default ) const; virtual TQSize sizeFromContents( ContentsType contents, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQSize &contentsSize, const TQStyleOption& = TQStyleOption::Default, @@ -1083,7 +1084,7 @@ public: // New API virtual int styleHint( StyleHint stylehint, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQStyleOption& = TQStyleOption::Default, TQStyleHintReturn* returnData = 0, @@ -1115,7 +1116,7 @@ public: const TQStyleOption& = TQStyleOption::Default ) const; virtual TQPixmap stylePixmap( StylePixmap stylepixmap, - TQStyleControlElementData ceData, + const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQStyleOption& = TQStyleOption::Default, const TQWidget *widget = 0 ) const = 0; @@ -1126,7 +1127,7 @@ public: static TQRect visualRect( const TQRect &logical, const TQWidget *w ); // New API - static TQRect visualRect( const TQRect &logical, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags ); + static TQRect visualRect( const TQRect &logical, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags ); static TQRect visualRect( const TQRect &logical, const TQRect &bounding ); @@ -1135,13 +1136,13 @@ public: typedef TQMap<void*, TQStyle*> ObjectEventSourceToHandlerMap; typedef TQMap<void*, TQStyleControlElementData> ObjectEventSourceDataToHandlerMap; typedef TQMap<void*, ControlElementFlags> ObjectEventSourceFlagsToHandlerMap; - typedef bool (*EventHandlerInstallationHook)(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler); - typedef bool (*EventHandlerRemovalHook)(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler); - void installObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ); - void removeObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ); + typedef bool (*EventHandlerInstallationHook)(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler); + typedef bool (*EventHandlerRemovalHook)(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler); + void installObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ); + void removeObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ); void setEventHandlerInstallationHook( EventHandlerInstallationHook ); void setEventHandlerRemovalHook( EventHandlerRemovalHook hook ); - virtual bool objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ); + virtual bool objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ); enum WidgetActionRequest { WAR_Repaint, @@ -1165,37 +1166,40 @@ public: WAR_SendPaintEvent }; - typedef bool (*WidgetActionRequestHook)(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, TQStyleWidgetActionRequestData requestData); + typedef bool (*WidgetActionRequestHook)(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, TQStyleWidgetActionRequestData requestData); void setWidgetActionRequestHook( WidgetActionRequestHook ); - virtual bool widgetActionRequest( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, TQStyleWidgetActionRequestData requestData = TQStyleWidgetActionRequestData() ); + virtual bool widgetActionRequest( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, TQStyleWidgetActionRequestData requestData = TQStyleWidgetActionRequestData() ); enum ApplicationActionRequest { AAR_SetPalette, AAR_SetFont }; - typedef bool (*ApplicationActionRequestHook)(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, TQStyleApplicationActionRequestData requestData); + typedef bool (*ApplicationActionRequestHook)(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, TQStyleApplicationActionRequestData requestData); void setApplicationActionRequestHook( ApplicationActionRequestHook ); - virtual bool applicationActionRequest( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, TQStyleApplicationActionRequestData requestData = TQStyleApplicationActionRequestData() ); + virtual bool applicationActionRequest( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, TQStyleApplicationActionRequestData requestData = TQStyleApplicationActionRequestData() ); // Old 2.x TQStyle API #ifndef QT_NO_COMPAT int defaultFrameWidth() const { - return pixelMetric( PM_DefaultFrameWidth, TQStyleControlElementData(), CEF_None ); + TQStyleControlElementData ceData; + return pixelMetric( PM_DefaultFrameWidth, ceData, CEF_None ); } void tabbarMetrics( const TQWidget* t, int& hf, int& vf, int& ov ) const { - hf = pixelMetric( PM_TabBarTabHSpace, TQStyleControlElementData(), CEF_None, t ); - vf = pixelMetric( PM_TabBarTabVSpace, TQStyleControlElementData(), CEF_None, t ); - ov = pixelMetric( PM_TabBarBaseOverlap, TQStyleControlElementData(), CEF_None, t ); + TQStyleControlElementData 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 ); } TQSize scrollBarExtent() const { - return TQSize(pixelMetric(PM_ScrollBarExtent, TQStyleControlElementData(), CEF_None), - pixelMetric(PM_ScrollBarExtent, TQStyleControlElementData(), CEF_None)); + TQStyleControlElementData ceData; + return TQSize(pixelMetric(PM_ScrollBarExtent, ceData, CEF_None), + pixelMetric(PM_ScrollBarExtent, ceData, CEF_None)); } #endif diff --git a/src/kernel/ntqwidget.h b/src/kernel/ntqwidget.h index d7c8cb583..bac3d6bc9 100644 --- a/src/kernel/ntqwidget.h +++ b/src/kernel/ntqwidget.h @@ -63,6 +63,7 @@ class TQFocusData; class TQCursor; class TQWSRegionManager; class TQStyle; +class TQStyleControlElementData; class Q_EXPORT TQWidget : public TQObject, public TQPaintDevice { @@ -1086,6 +1087,7 @@ struct Q_EXPORT TQWExtra { #endif TQRect micro_focus_hint; // micro focus hint TQSizePolicy size_policy; + TQStyleControlElementData* m_ceData; }; #define Q_DEFINED_QWIDGET diff --git a/src/kernel/qstyle.cpp b/src/kernel/qstyle.cpp index df83f00eb..845c2f150 100644 --- a/src/kernel/qstyle.cpp +++ b/src/kernel/qstyle.cpp @@ -54,7 +54,6 @@ #include <limits.h> - class TQStylePrivate { public: @@ -495,7 +494,7 @@ void TQStyle::unPolish( TQWidget *widget ) { \sa unPolish() */ -void TQStyle::polish( TQStyleControlElementData ceData, ControlElementFlags, void *ptr ) { +void TQStyle::polish( const TQStyleControlElementData &ceData, ControlElementFlags, void *ptr ) { if (ceData.widgetObjectTypes.contains("TQWidget")) { // Enable dynamic hide/show of accelerator shortcuts TQWidget* widget = reinterpret_cast<TQWidget*>(ptr); @@ -513,7 +512,7 @@ void TQStyle::polish( TQStyleControlElementData ceData, ControlElementFlags, voi \sa polish() */ -void TQStyle::unPolish( TQStyleControlElementData ceData, ControlElementFlags, void *ptr ) { +void TQStyle::unPolish( const TQStyleControlElementData &ceData, ControlElementFlags, void *ptr ) { if (ceData.widgetObjectTypes.contains("TQWidget")) { // Disable dynamic hide/show of accelerator shortcuts TQWidget* widget = reinterpret_cast<TQWidget*>(ptr); @@ -555,7 +554,7 @@ void TQStyle::unPolish( TQApplication *app ) { \sa unPolish() */ -void TQStyle::applicationPolish( TQStyleControlElementData, ControlElementFlags, void * ) { +void TQStyle::applicationPolish( const TQStyleControlElementData&, ControlElementFlags, void * ) { // } @@ -571,7 +570,7 @@ void TQStyle::applicationPolish( TQStyleControlElementData, ControlElementFlags, \sa polish() */ -void TQStyle::applicationUnPolish( TQStyleControlElementData, ControlElementFlags, void * ) { +void TQStyle::applicationUnPolish( const TQStyleControlElementData&, ControlElementFlags, void * ) { // } @@ -605,7 +604,7 @@ void TQStyle::polishPopupMenu( TQPopupMenu *pm ) { (\l{TQPopupMenu::setMouseTracking()}) and whether the menu is checkable by default (\l{TQPopupMenu::setCheckable()}). */ -void TQStyle::polishPopupMenu( TQStyleControlElementData, ControlElementFlags, void * ) +void TQStyle::polishPopupMenu( const TQStyleControlElementData&, ControlElementFlags, void * ) { } @@ -909,7 +908,7 @@ void TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn void TQStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags flags, const TQStyleOption& opt) const + \fn void TQStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags flags, const TQStyleOption& 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 TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn void TQStyle::drawControl( ControlElement element, TQPainter *p, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags how, const TQStyleOption& opt, const TQWidget *widget) const + \fn void TQStyle::drawControl( ControlElement element, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags how, const TQStyleOption& opt, const TQWidget *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 TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn void TQStyle::drawControlMask( ControlElement element, TQPainter *p, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &r, const TQStyleOption& opt, const TQWidget *widget) const + \fn void TQStyle::drawControlMask( ControlElement element, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQStyleOption& opt, const TQWidget *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 TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn TQRect TQStyle::subRect( SubRect subrect, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget ) const; + \fn TQRect TQStyle::subRect( SubRect subrect, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQWidget *widget ) const; Returns the sub-area \a subrect for the \a widget in logical coordinates. @@ -1406,7 +1405,7 @@ void TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn void TQStyle::drawComplexControl( ComplexControl control, TQPainter *p, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags how, SCFlags sub, SCFlags subActive, const TQStyleOption& opt, const TQWidget *widget ) const + \fn void TQStyle::drawComplexControl( ComplexControl control, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags how, SCFlags sub, SCFlags subActive, const TQStyleOption& opt, const TQWidget *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 TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn void TQStyle::drawComplexControlMask( ComplexControl control, TQPainter *p, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQRect &r, const TQStyleOption& opt, const TQWidget *widget) const + \fn void TQStyle::drawComplexControlMask( ComplexControl control, TQPainter *p, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQRect &r, const TQStyleOption& opt, const TQWidget *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 TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn TQRect TQStyle::querySubControlMetrics( ComplexControl control, TQStyleControlElementData ceData, ControlElementFlags elementFlags, SubControl subcontrol, const TQStyleOption& opt = TQStyleOption::Default, const TQWidget *widget = 0 ) const; + \fn TQRect TQStyle::querySubControlMetrics( ComplexControl control, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl subcontrol, const TQStyleOption& opt = TQStyleOption::Default, const TQWidget *widget = 0 ) const; Returns the rect for the SubControl \a subcontrol for \a widget in logical coordinates. @@ -1546,7 +1545,7 @@ void TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn SubControl TQStyle::querySubControl( ComplexControl control, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQPoint &pos, const TQStyleOption& opt = TQStyleOption::Default, const TQWidget *widget = 0 ) const; + \fn SubControl TQStyle::querySubControl( ComplexControl control, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQPoint &pos, const TQStyleOption& opt = TQStyleOption::Default, const TQWidget *widget = 0 ) const; Returns the SubControl for \a widget at the point \a pos. The \a widget argument is a pointer to a TQWidget or one of its @@ -1672,7 +1671,7 @@ void TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn int TQStyle::pixelMetric( PixelMetric metric, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQWidget *widget = 0 ) const; + \fn int TQStyle::pixelMetric( PixelMetric metric, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget *widget = 0 ) const; Returns the pixel metric for \a metric. @@ -1734,7 +1733,7 @@ void TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn TQSize TQStyle::sizeFromContents( ContentsType contents, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQSize &contentsSize, const TQStyleOption& opt = TQStyleOption::Default, const TQWidget *widget = 0 ) const; + \fn TQSize TQStyle::sizeFromContents( ContentsType contents, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQSize &contentsSize, const TQStyleOption& opt = TQStyleOption::Default, const TQWidget *widget = 0 ) const; Returns the size of \a widget based on the contents size \a contentsSize. @@ -1924,7 +1923,7 @@ void TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn int TQStyle::styleHint( StyleHint stylehint, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &opt = TQStyleOption::Default, TQStyleHintReturn *returnData = 0, const TQWidget *widget = 0 ) const; + \fn int TQStyle::styleHint( StyleHint stylehint, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQStyleOption &opt = TQStyleOption::Default, TQStyleHintReturn *returnData = 0, const TQWidget *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 TQStyle::drawItem( TQPainter *p, const TQRect &r, */ /*! - \fn TQPixmap TQStyle::stylePixmap( StylePixmap stylepixmap, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption& opt = TQStyleOption::Default, const TQWidget *widget = 0 ) const; + \fn TQPixmap TQStyle::stylePixmap( StylePixmap stylepixmap, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQStyleOption& opt = TQStyleOption::Default, const TQWidget *widget = 0 ) const; Returns a pixmap for \a stylepixmap. @@ -2011,7 +2010,7 @@ void TQStyle::drawItem( TQPainter *p, const TQRect &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 TQRect &logical, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags ); + Note that this function is deprecated in favor of visualRect( const TQRect &logical, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags ); \sa TQApplication::reverseLayout() */ @@ -2023,7 +2022,7 @@ TQRect TQStyle::visualRect( const TQRect &logical, const TQWidget *w ) } /*! - \fn TQRect TQStyle::visualRect( const TQRect &logical, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags ); + \fn TQRect TQStyle::visualRect( const TQRect &logical, const TQStyleControlElementData &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 @@ TQRect TQStyle::visualRect( const TQRect &logical, const TQWidget *w ) \sa TQApplication::reverseLayout() */ -TQRect TQStyle::visualRect( const TQRect &logical, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags ) +TQRect TQStyle::visualRect( const TQRect &logical, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags ) { Q_UNUSED(elementFlags) @@ -2065,15 +2064,15 @@ TQRect TQStyle::visualRect( const TQRect &logical, const TQRect &boundingRect ) } /*! - \fn void TQStyle::installObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ); + \fn void TQStyle::installObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ); Intercepts events generated by \a source and sends them to \a handler via - the bool TQStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ) virtual method. + the bool TQStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ) virtual method. \sa void TQStyle::removeObjectEventHandler( TQObject* source, TQStyle* handler ) - \sa bool TQStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ) + \sa bool TQStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ) */ -void TQStyle::installObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) { +void TQStyle::installObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) { bool cbret = false; if (m_eventHandlerInstallationHook) { cbret = (*m_eventHandlerInstallationHook)(ceData, elementFlags, source, handler); @@ -2090,13 +2089,13 @@ void TQStyle::installObjectEventHandler( TQStyleControlElementData ceData, Contr } /*! - \fn void TQStyle::removeObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ); + \fn void TQStyle::removeObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ); Stops intercepting events generated by \a source. - \sa void TQStyle::installObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) + \sa void TQStyle::installObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) */ -void TQStyle::removeObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) { +void TQStyle::removeObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) { bool cbret = false; if (m_eventHandlerRemovalHook) { cbret = (*m_eventHandlerRemovalHook)(ceData, elementFlags, source, handler); @@ -2117,9 +2116,9 @@ void TQStyle::removeObjectEventHandler( TQStyleControlElementData ceData, Contro Sets a callback function \a hook which will be called whenever a new intercept request is made via the TQStyle::installObjectEventHandler method. The callback function must - use this definition: bool callbackFunction( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ). + use this definition: bool callbackFunction( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ). - \sa void TQStyle::installObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) + \sa void TQStyle::installObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) */ void TQStyle::setEventHandlerInstallationHook( EventHandlerInstallationHook hook ) { m_eventHandlerInstallationHook = hook; @@ -2130,24 +2129,24 @@ void TQStyle::setEventHandlerInstallationHook( EventHandlerInstallationHook hook Sets a callback function \a hook which will be called whenever a new intercept deactivation request is made via the TQStyle::removeObjectEventHandler method. The callback function must - use this definition: bool callbackFunction( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ). + use this definition: bool callbackFunction( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ). - \sa void TQStyle::removeObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) + \sa void TQStyle::removeObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) */ void TQStyle::setEventHandlerRemovalHook( EventHandlerRemovalHook hook ) { m_eventHandlerRemovalHook = hook; } /*! - \fn bool TQStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ); + \fn bool TQStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ); Override this virtual function to intercept events requested by a previous call to TQStyle::installObjectEventHandler. - \sa void TQStyle::installObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) - \sa void TQStyle::removeObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) + \sa void TQStyle::installObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) + \sa void TQStyle::removeObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) */ -bool TQStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ) { +bool TQStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ) { Q_UNUSED(ceData); Q_UNUSED(elementFlags); Q_UNUSED(source); @@ -2193,20 +2192,20 @@ bool TQStyle::eventFilter(TQObject *o, TQEvent *e) { Sets a callback function \a hook which will be called whenever a new widget action request is made via the TQStyle::installObjectEventHandler method. The callback function must - use this definition: bool callbackFunction( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ). + use this definition: bool callbackFunction( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ). - \sa void TQStyle::installObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) + \sa void TQStyle::installObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) */ void TQStyle::setWidgetActionRequestHook( WidgetActionRequestHook hook ) { m_widgetActionRequestHook = hook; } /*! - \fn bool widgetActionRequestHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request ); + \fn bool widgetActionRequestHandler( const TQStyleControlElementData &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 TQStyle::widgetActionRequest( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, TQStyleWidgetActionRequestData requestData ) { +bool TQStyle::widgetActionRequest( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, TQStyleWidgetActionRequestData requestData ) { bool cbret = false; if (m_widgetActionRequestHook) { cbret = (*m_widgetActionRequestHook)(ceData, elementFlags, source, request, requestData); @@ -2327,20 +2326,20 @@ bool TQStyle::widgetActionRequest( TQStyleControlElementData ceData, ControlElem Sets a callback function \a hook which will be called whenever a new application action request is made via the TQStyle::installObjectEventHandler method. The callback function must - use this definition: bool callbackFunction( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ). + use this definition: bool callbackFunction( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ). - \sa void TQStyle::installObjectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) + \sa void TQStyle::installObjectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQStyle* handler ) */ void TQStyle::setApplicationActionRequestHook( ApplicationActionRequestHook hook ) { m_applicationActionRequestHook = hook; } /*! - \fn bool applicationActionRequestHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request ); + \fn bool applicationActionRequestHandler( const TQStyleControlElementData &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 TQStyle::applicationActionRequest( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, TQStyleApplicationActionRequestData requestData ) { +bool TQStyle::applicationActionRequest( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, ApplicationActionRequest request, TQStyleApplicationActionRequestData requestData ) { bool cbret = false; if (m_applicationActionRequestHook) { cbret = (*m_applicationActionRequestHook)(ceData, elementFlags, source, request, requestData); @@ -2609,6 +2608,7 @@ TQPixmap TQStyle::stylePixmap(StylePixmap sp, const TQWidget *w, const TQStyleOp */ TQStyleControlElementData::TQStyleControlElementData() { + isNull = true; activePainter = 0; tickMarkSetting = 0; comboBoxLineEditFlags = 0; diff --git a/src/kernel/qwidget.cpp b/src/kernel/qwidget.cpp index a29036c1f..f7ed299fb 100644 --- a/src/kernel/qwidget.cpp +++ b/src/kernel/qwidget.cpp @@ -1184,6 +1184,9 @@ void TQWidget::createExtra() #endif extra->size_policy = TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Preferred ); + + extra->m_ceData = NULL; + createSysExtra(); } } @@ -3591,7 +3594,15 @@ bool TQWidget::isActiveWindow() const if(tlw == tqApp->activeWindow() || ( isVisible() && tlw->isPopup() )) return TRUE; #ifndef QT_NO_STYLE - if(style().styleHint(TQStyle::SH_Widget_ShareActivation, this )) { + const_cast<TQWidget*>(this)->createExtra(); + if (!extra->m_ceData) { + const_cast<TQWidget*>(this)->extra->m_ceData = new TQStyleControlElementData(); + } + //extra->m_ceData->widgetObjectTypes = getObjectTypeListForObject(this); + extra->m_ceData->widgetObjectTypes.clear(); + extra->m_ceData->allDataPopulated = false; + //if(style().styleHint(TQStyle::SH_Widget_ShareActivation, *extra->m_ceData, getControlElementFlagsForObject(this, extra->m_ceData->widgetObjectTypes, TQStyleOption(), false), TQStyleOption(), NULL, this)) { + if(style().styleHint(TQStyle::SH_Widget_ShareActivation, *extra->m_ceData, TQStyle::CEF_None, TQStyleOption(), NULL, this)) { if((tlw->isDialog() || (tlw->testWFlags(TQt::WStyle_Tool) && !tlw->isPopup())) && !tlw->testWFlags(TQt::WShowModal) && (!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow())) |