diff options
author | Darrell Anderson <[email protected]> | 2012-08-08 15:38:38 -0500 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2012-08-08 15:38:38 -0500 |
commit | a236ea2ad383387255621fc8eaddc3c5d17f1e30 (patch) | |
tree | ecacdf1f8c9c02f545e06f8a430a145998fe11ea /src/styles/qcompactstyle.cpp | |
parent | 92b8aca467ad650f9b77a5b6a0f56c27ecbfe80a (diff) | |
parent | 47132557a4c58d4ad69bc2898bb2bd9c424b3b64 (diff) | |
download | qt3-a236ea2ad383387255621fc8eaddc3c5d17f1e30.tar.gz qt3-a236ea2ad383387255621fc8eaddc3c5d17f1e30.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/qt3
Diffstat (limited to 'src/styles/qcompactstyle.cpp')
-rw-r--r-- | src/styles/qcompactstyle.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/styles/qcompactstyle.cpp b/src/styles/qcompactstyle.cpp index 46b4df3..7c8d93b 100644 --- a/src/styles/qcompactstyle.cpp +++ b/src/styles/qcompactstyle.cpp @@ -55,7 +55,7 @@ QCompactStyle::QCompactStyle() } /*! \reimp */ -int QCompactStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) +int QCompactStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) { int ret; switch ( metric ) { @@ -68,7 +68,7 @@ int QCompactStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) ret = -1; break; default: - ret = QWindowsStyle::pixelMetric( metric, widget ); + ret = QWindowsStyle::pixelMetric( metric, ceData, elementFlags, widget ); break; } return ret; @@ -143,16 +143,15 @@ void drawPopupMenuItem( QPainter* p, bool checkable, } /*! \reimp */ -void QCompactStyle::drawControl( ControlElement element, QPainter *p, const QWidget *widget, const QRect &r, - const QColorGroup &g, SFlags flags, const QStyleOption& opt ) +void QCompactStyle::drawControl( ControlElement element, QPainter *p, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QRect &r, + const QColorGroup &g, SFlags flags, const QStyleOption& opt, const QWidget *widget ) { switch ( element ) { case CE_PopupMenuItem: { - if (! widget || opt.isDefault()) + if (! (elementFlags & CEF_HasWidget) || opt.isDefault()) break; - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; QMenuItem *mi = opt.menuItem(); if ( !mi ) break; @@ -160,7 +159,7 @@ void QCompactStyle::drawControl( ControlElement element, QPainter *p, const QWid int tab = opt.tabWidth(); int maxpmw = opt.maxIconWidth(); bool dis = !(flags & Style_Enabled); - bool checkable = popupmenu->isCheckable(); + bool checkable = (elementFlags & CEF_IsCheckable); bool act = flags & Style_Active; int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -313,7 +312,7 @@ void QCompactStyle::drawControl( ControlElement element, QPainter *p, const QWid break; default: - QWindowsStyle::drawControl( element, p, widget, r, g, flags, opt ); + QWindowsStyle::drawControl( element, p, ceData, elementFlags, r, g, flags, opt, widget ); break; } } |