// set background and size it correctly
( this )->resize( 569, 458 );
setPaletteBackgroundPixmap
( QPixmap::fromMimeSource( "images/Exemple_Background.png" ) );
// track mouse moves
setMouseTracking ( true );
// exit push button
pbClose
->resize
( QSize( 10,
10 ) );
pbClose->move( 551, 5 ); // position over background
pbClose
->setMask
( QBitmap() );
// for transparency
connect( pbClose, SIGNAL( clicked() ), this, SLOT( close() ) );
connect( pbClose,
SIGNAL( QEvent::Enter ),
this,
SLOT ( changeCursor
() ) );
connect( pbClose,
SIGNAL( QEvent::Leave ),
this,
SLOT ( resetCursor
() ) );
// set background and size it correctly
QWidget *main = new QWidget( this );
( this )->resize( 569, 458 );
setPaletteBackgroundPixmap
( QPixmap::fromMimeSource( "images/Exemple_Background.png" ) );
// track mouse moves
setMouseTracking ( true );
// exit push button
QPushButton * pbClose = new QPushButton ( this );
pbClose->resize( QSize( 10, 10 ) );
pbClose->move( 551, 5 ); // position over background
pbClose->setMask( QBitmap() ); // for transparency
connect( pbClose, SIGNAL( clicked() ), this, SLOT( close() ) );
connect( pbClose, SIGNAL( QEvent::Enter ), this, SLOT ( changeCursor() ) );
connect( pbClose, SIGNAL( QEvent::Leave ), this, SLOT ( resetCursor() ) );
To copy to clipboard, switch view to plain text mode
1. setMouseTracking must be wrongly implemented because it never starts the slots,
Bookmarks