summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/audiowidget.cpp
authorsimon <simon>2002-12-09 14:48:13 (UTC)
committer simon <simon>2002-12-09 14:48:13 (UTC)
commit9ab8a657b23fd1871c4a376fdd097732c14392e0 (patch) (side-by-side diff)
tree5e507bf74fad84ae6da1ed1facc689fd89de167d /noncore/multimedia/opieplayer2/audiowidget.cpp
parent174c4a427750a3829ffd81a87454be8abf61ee30 (diff)
downloadopie-9ab8a657b23fd1871c4a376fdd097732c14392e0.zip
opie-9ab8a657b23fd1871c4a376fdd097732c14392e0.tar.gz
opie-9ab8a657b23fd1871c4a376fdd097732c14392e0.tar.bz2
- migrating from a button vector to a button map
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index c148820..12f91a9 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -120,7 +120,7 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
}
}
- buttons.push_back( button );
+ buttons.insert( i, button );
}
setBackgroundPixmap( pixBg );
@@ -208,7 +208,7 @@ void AudioWidget::resizeEvent( QResizeEvent * ) {
QPixmap pixUp = combineImageWithBackground( imgUp, pixBg, p );
QPixmap pixDn = combineImageWithBackground( imgDn, pixBg, p );
- for ( uint i = 0; i < buttons.size(); i++ ) {
+ for ( uint i = 0; i < buttons.count(); i++ ) {
if ( !buttons[i].mask.isNull() ) {
buttons[i].pixUp = maskPixToMask( pixUp, buttons[i].mask );
buttons[i].pixDown = maskPixToMask( pixDn, buttons[i].mask );
@@ -351,7 +351,7 @@ void AudioWidget::timerEvent( QTimerEvent * ) {
void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
- for ( unsigned int i = 0; i < buttons.size(); i++ ) {
+ for ( unsigned int i = 0; i < buttons.count(); i++ ) {
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the button or not
bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i );
@@ -414,13 +414,13 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
- for ( unsigned int i = 0; i < buttons.size(); i++ )
+ for ( unsigned int i = 0; i < buttons.count(); i++ )
paintButton( p, i );
QPainter p2( this );
p2.drawPixmap( pe->rect().topLeft(), pix );
} else {
QPainter p( this );
- for ( unsigned int i = 0; i < buttons.size(); i++ )
+ for ( unsigned int i = 0; i < buttons.count(); i++ )
paintButton( p, i );
}
}