Mailinglist Archive: yast-commit (683 mails)

< Previous Next >
[yast-commit] r42740 - in /branches/tmp/coolo/qt4-port/src: YQBarGraph.cc YQBarGraph.h
  • From: coolo@xxxxxxxxxxxxxxxx
  • Date: Wed, 05 Dec 2007 19:20:27 -0000
  • Message-id: <20071205192028.07FA72F6A6@xxxxxxxxxxxxxxxx>
Author: coolo
Date: Wed Dec 5 20:20:27 2007
New Revision: 42740

URL: http://svn.opensuse.org/viewcvs/yast?rev=42740&view=rev
Log:
drawContent is no more

Modified:
branches/tmp/coolo/qt4-port/src/YQBarGraph.cc
branches/tmp/coolo/qt4-port/src/YQBarGraph.h

Modified: branches/tmp/coolo/qt4-port/src/YQBarGraph.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQBarGraph.cc?rev=42740&r1=42739&r2=42740&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQBarGraph.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQBarGraph.cc Wed Dec 5 20:20:27 2007
@@ -59,8 +59,12 @@


void
-YQBarGraph::drawContents( QPainter * painter )
+YQBarGraph::paintEvent( QPaintEvent* paintEvent )
{
+ QFrame::paintEvent( paintEvent );
+
+ QPainter painter( this );
+
unsigned nextDefaultColor = 0;
int totalWidth = contentsRect().width() - 2*YQBarGraphOuterMargin;
int segHeight = contentsRect().height() - 2*YQBarGraphOuterMargin;
@@ -104,19 +108,19 @@
textColor = defaultTextColor ( nextDefaultColor++ );
}

- painter->setBrush( QColor( segmentColor.red(),
+ painter.setBrush( QColor( segmentColor.red(),
segmentColor.green(),
segmentColor.blue() ) );
- painter->setPen( Qt::NoPen );
- painter->drawRect( x_off, y_off, segWidth+2, segHeight+2 );
+ painter.setPen( Qt::NoPen );
+ painter.drawRect( x_off, y_off, segWidth+2, segHeight+2 );


//
// Draw the label
//

- painter->setPen( Qt::SolidLine );
- painter->setPen( QColor( textColor.red(),
+ painter.setPen( Qt::SolidLine );
+ painter.setPen( QColor( textColor.red(),
textColor.green(),
textColor.blue() ) );

@@ -125,7 +129,7 @@
if ( txt.contains( "%1" ) )
txt = txt.arg( seg.value() ); // substitute variable

- painter->drawText( x_off + YQBarGraphLabelHorizontalMargin,
+ painter.drawText( x_off + YQBarGraphLabelHorizontalMargin,
y_off + YQBarGraphLabelVerticalMargin,
segWidth - 2 * YQBarGraphLabelHorizontalMargin + 1,
segHeight - 2 * YQBarGraphLabelVerticalMargin + 1,

Modified: branches/tmp/coolo/qt4-port/src/YQBarGraph.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQBarGraph.h?rev=42740&r1=42739&r2=42740&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQBarGraph.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQBarGraph.h Wed Dec 5 20:20:27 2007
@@ -85,7 +85,7 @@
*
* Reimplemented from QFrame.
**/
- virtual void drawContents( QPainter * painter );
+ virtual void paintEvent( QPaintEvent * painter );

/**
* Return one from a set of default segment background colors.

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages