author | simon <simon> | 2002-12-08 22:53:07 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-08 22:53:07 (UTC) |
commit | cb1b7bf6f4dd465cc4f5b268893def8b11ce0bde (patch) (side-by-side diff) | |
tree | 9e6497f79f24c690b5fdb737be5d38a3d5efcee5 | |
parent | 786bc677f61983414df8a4613cc525c4bcd2a054 (diff) | |
download | opie-cb1b7bf6f4dd465cc4f5b268893def8b11ce0bde.zip opie-cb1b7bf6f4dd465cc4f5b268893def8b11ce0bde.tar.gz opie-cb1b7bf6f4dd465cc4f5b268893def8b11ce0bde.tar.bz2 |
- some preparations for further code cleanups for paintButton calls
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
5 files changed, 17 insertions, 14 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index d083273..10b1e58 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -338,3 +338,3 @@ void AudioWidget::toggleButton( int i ) { QPainter p(this); - paintButton ( &p, i ); + paintButton ( p, i ); } @@ -342,7 +342,7 @@ void AudioWidget::toggleButton( int i ) { -void AudioWidget::paintButton( QPainter *p, int i ) { +void AudioWidget::paintButton( QPainter &p, int i ) { if ( buttons[i].isDown ) { - p->drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); + p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); } else { - p->drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); + p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); } @@ -444,3 +444,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { for ( unsigned int i = 0; i < buttons.size(); i++ ) - paintButton( &p, i ); + paintButton( p, i ); QPainter p2( this ); @@ -450,3 +450,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { for ( unsigned int i = 0; i < buttons.size(); i++ ) - paintButton( &p, i ); + paintButton( p, i ); } diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index acf2dda..a1a839c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -95,3 +95,3 @@ private: void setToggleButton( int, bool ); - void paintButton( QPainter *p, int i ); + virtual void paintButton( QPainter &p, int i ); int skipDirection; diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 6e12a3b..066d2ac 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -69,2 +69,5 @@ protected: + void paintButton( int buttonId ); + virtual void paintButton( QPainter &p, int i ) = 0; + MediaPlayerState &mediaPlayerState; diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 6451ac4..3e677c6 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -268,11 +268,11 @@ void VideoWidget::toggleButton( int i ) { QPainter p(this); - paintButton ( &p, i ); + paintButton ( p, i ); } -void VideoWidget::paintButton( QPainter *p, int i ) { +void VideoWidget::paintButton( QPainter &p, int i ) { if ( buttons[i].isDown ) { - p->drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); + p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); } else { - p->drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); + p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); } @@ -424,3 +424,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { for ( unsigned int i = 0; i < buttons.size(); i++ ) { - paintButton( &p, i ); + paintButton( p, i ); } @@ -431,3 +431,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { for ( unsigned int i = 0; i < buttons.size(); i++ ) - paintButton( &p, i ); + paintButton( p, i ); } diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 2a9f1e0..28f720b 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -109,3 +109,3 @@ private: - void paintButton( QPainter *p, int i ); + virtual void paintButton( QPainter &p, int i ); void toggleButton( int ); |