author | simon <simon> | 2002-12-02 22:58:05 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 22:58:05 (UTC) |
commit | 779219b813f0eba82a8d9236fafd28dbafc594d1 (patch) (side-by-side diff) | |
tree | cee0e78617f0e5c56c9ee8eaf44c41337faea977 /noncore/multimedia/opieplayer2/videowidget.cpp | |
parent | b3bf297da8836a678a21f2ebe83e0f1961f91d97 (diff) | |
download | opie-779219b813f0eba82a8d9236fafd28dbafc594d1.zip opie-779219b813f0eba82a8d9236fafd28dbafc594d1.tar.gz opie-779219b813f0eba82a8d9236fafd28dbafc594d1.tar.bz2 |
- replaced QPixmap and QImage pointer usage with value usage
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 41dddb7..c0039b1 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -99,8 +99,8 @@ MediaWidget( mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 QString skinPath = "opieplayer2/skins/" + skin; - pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); - imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); - imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); + pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); + imgUp = QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); + imgDn = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); - imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); - imgButtonMask->fill( 0 ); + imgButtonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); + imgButtonMask.fill( 0 ); @@ -112,6 +112,6 @@ MediaWidget( mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 QImage imgMask = masks[i]->convertToImage(); - uchar **dest = imgButtonMask->jumpTable(); - for ( int y = 0; y < imgUp->height(); y++ ) { + uchar **dest = imgButtonMask.jumpTable(); + for ( int y = 0; y < imgUp.height(); y++ ) { uchar *line = dest[y]; - for ( int x = 0; x < imgUp->width(); x++ ) { + for ( int x = 0; x < imgUp.width(); x++ ) { if ( !qRed( imgMask.pixel( x, y ) ) ) @@ -128,3 +128,3 @@ MediaWidget( mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 - setBackgroundPixmap( *pixBg ); + setBackgroundPixmap( pixBg ); @@ -152,6 +152,2 @@ VideoWidget::~VideoWidget() { - delete pixBg; - delete imgUp; - delete imgDn; - delete imgButtonMask; for ( int i = 0; i < 7; i++ ) { @@ -186,3 +182,3 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { slider->setFocusPolicy( QWidget::NoFocus ); - slider->setBackgroundPixmap( *pixBg ); + slider->setBackgroundPixmap( pixBg ); @@ -195,4 +191,4 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { - QPixmap *pixUp = combineVImageWithBackground( *imgUp, *pixBg, p ); - QPixmap *pixDn = combineVImageWithBackground( *imgDn, *pixBg, p ); + QPixmap *pixUp = combineVImageWithBackground( imgUp, pixBg, p ); + QPixmap *pixDn = combineVImageWithBackground( imgDn, pixBg, p ); @@ -293,5 +289,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() - && y < imgButtonMask->height() - && imgButtonMask->pixelIndex( x, y ) == i + 1 ); + bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask.width() + && y < imgButtonMask.height() + && imgButtonMask.pixelIndex( x, y ) == i + 1 ); @@ -388,3 +384,3 @@ void VideoWidget::makeVisible() { showMaximized(); - setBackgroundPixmap( *pixBg ); + setBackgroundPixmap( pixBg ); QWidget *d = QApplication::desktop(); @@ -433,3 +429,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); - p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); + p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); for ( int i = 0; i < numVButtons; i++ ) { |