diff options
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; } } |