summaryrefslogtreecommitdiffstats
path: root/src/styles/qcompactstyle.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-05 01:00:53 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-05 01:00:53 -0500
commit0008bc5bcd95694b38b0d0322aac2ea6fdb21298 (patch)
treee36a2a63a9784451af847fc952b281969cb8c0c0 /src/styles/qcompactstyle.cpp
parentebcb1d80bf517aceb69778e1e9f67e5f4da8c484 (diff)
downloadqt3-0008bc5bcd95694b38b0d0322aac2ea6fdb21298.tar.gz
qt3-0008bc5bcd95694b38b0d0322aac2ea6fdb21298.zip
Update style API to function without an active widget object
Diffstat (limited to 'src/styles/qcompactstyle.cpp')
-rw-r--r--src/styles/qcompactstyle.cpp15
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;
}
}