#include <qpixmap.h>
#include <qpushbutton.h>
#include <qbitmap.h>
#include <qcursor.h>
#include <qevent.h>
#include "application.h"
ApplicationWindow::ApplicationWindow()
Qt::WStyle_Customize |
Qt::WStyle_Splash |
WDestructiveClose |
WGroupLeader )
{
// set background and size it correctly
( this )->resize( 569, 458 );
setPaletteBackgroundPixmap
( QPixmap::fromMimeSource( "images/Exemple_Background.png" ) );
// exit push button
// track mouse moves
pbClose->setMouseTracking ( true );
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
() ) );
}
//****************************************************************
ApplicationWindow::~ApplicationWindow()
{
}
//****************************************************************
void ApplicationWindow::changeCursor()
{
close();
// QCursor( 2 ); //QCursor::PointingHandCursor);
return;
}
//****************************************************************
void ApplicationWindow::resetCursor()
{
close();
return;
}
#include <qpixmap.h>
#include <qpushbutton.h>
#include <qbitmap.h>
#include <qcursor.h>
#include <qevent.h>
#include "application.h"
ApplicationWindow::ApplicationWindow()
: QMainWindow( 0, "Application",
Qt::WStyle_Customize |
Qt::WStyle_Splash |
WDestructiveClose |
WGroupLeader )
{
// set background and size it correctly
QWidget *main = new QWidget( this );
( this )->resize( 569, 458 );
setPaletteBackgroundPixmap
( QPixmap::fromMimeSource( "images/Exemple_Background.png" ) );
// exit push button
QPushButton * pbClose = new QPushButton ( this );
// track mouse moves
pbClose->setMouseTracking ( true );
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() ) );
}
//****************************************************************
ApplicationWindow::~ApplicationWindow()
{
}
//****************************************************************
void ApplicationWindow::changeCursor()
{
close();
// QCursor( 2 ); //QCursor::PointingHandCursor);
return;
}
//****************************************************************
void ApplicationWindow::resetCursor()
{
close();
return;
}
To copy to clipboard, switch view to plain text mode
and regarding invisible widgets, you are correct I will have to design them. How ?
Bookmarks