diff options
author | Timothy Pearson <[email protected]> | 2012-08-05 01:00:53 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-08-05 01:00:53 -0500 |
commit | 0008bc5bcd95694b38b0d0322aac2ea6fdb21298 (patch) | |
tree | e36a2a63a9784451af847fc952b281969cb8c0c0 /src/styles/qcdestyle.cpp | |
parent | ebcb1d80bf517aceb69778e1e9f67e5f4da8c484 (diff) | |
download | qt3-0008bc5bcd95694b38b0d0322aac2ea6fdb21298.tar.gz qt3-0008bc5bcd95694b38b0d0322aac2ea6fdb21298.zip |
Update style API to function without an active widget object
Diffstat (limited to 'src/styles/qcdestyle.cpp')
-rw-r--r-- | src/styles/qcdestyle.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/styles/qcdestyle.cpp b/src/styles/qcdestyle.cpp index d6621c0..3719462 100644 --- a/src/styles/qcdestyle.cpp +++ b/src/styles/qcdestyle.cpp @@ -87,7 +87,7 @@ QCDEStyle::~QCDEStyle() /*!\reimp */ -int QCDEStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) const +int QCDEStyle::pixelMetric( PixelMetric metric, QStyleControlElementData ceData, ControlElementFlags elementFlags, const QWidget *widget ) const { int ret; @@ -102,7 +102,7 @@ int QCDEStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) const ret = 13; break; default: - ret = QMotifStyle::pixelMetric( metric, widget ); + ret = QMotifStyle::pixelMetric( metric, ceData, elementFlags, widget ); break; } return ret; @@ -112,11 +112,13 @@ int QCDEStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) const */ void QCDEStyle::drawControl( ControlElement element, QPainter *p, - const QWidget *widget, + QStyleControlElementData ceData, + ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags how, - const QStyleOption& opt ) const + const QStyleOption& opt, + const QWidget *widget ) const { switch( element ) { @@ -127,11 +129,11 @@ void QCDEStyle::drawControl( ControlElement element, &cg.brush( QColorGroup::Button ) ); else // other item p->fillRect( r, cg.brush( QColorGroup::Button ) ); - QCommonStyle::drawControl( element, p, widget, r, cg, how, opt ); + QCommonStyle::drawControl( element, p, ceData, elementFlags, r, cg, how, opt, widget ); break; } default: - QMotifStyle::drawControl( element, p, widget, r, cg, how, opt ); + QMotifStyle::drawControl( element, p, ceData, elementFlags, r, cg, how, opt, widget ); break; } @@ -142,6 +144,8 @@ void QCDEStyle::drawControl( ControlElement element, */ void QCDEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, + QStyleControlElementData ceData, + ControlElementFlags elementFlags, const QRect &r, const QColorGroup &cg, SFlags flags, @@ -154,7 +158,7 @@ void QCDEStyle::drawPrimitive( PrimitiveElement pe, bool on = flags & Style_On; bool showUp = !( down ^ on ); QBrush fill = showUp || flags & Style_NoChange ? cg.brush( QColorGroup::Button ) : cg.brush( QColorGroup::Mid ); - qDrawShadePanel( p, r, cg, !showUp, pixelMetric( PM_DefaultFrameWidth ), &cg.brush( QColorGroup::Button ) ); + qDrawShadePanel( p, r, cg, !showUp, pixelMetric( PM_DefaultFrameWidth, ceData, elementFlags ), &cg.brush( QColorGroup::Button ) ); if ( !( flags & Style_Off ) ) { QPointArray a( 7 * 2 ); @@ -360,7 +364,7 @@ void QCDEStyle::drawPrimitive( PrimitiveElement pe, } break; default: - QMotifStyle::drawPrimitive( pe, p, r, cg, flags, opt ); + QMotifStyle::drawPrimitive( pe, p, ceData, elementFlags, r, cg, flags, opt ); } } |