Add background image support. Create a custom QMdiArea to handle it

This commit is contained in:
jfmcarreira committed 2014-08-25 02:23:27 +01:00
1 parent a5a9b7e044
commit 623d2e78d3
4 files changed
+31 -3

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ plaYUVerApp::plaYUVerApp()
setWindowModality( Qt::ApplicationModal );
mdiArea = new QMdiArea;
mdiArea = new PlaYUVerMdiArea;
setCentralWidget( mdiArea );
//mdiArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
//mdiArea->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
+28 -2
View File
@@ -113,7 +113,34 @@ private Q_SLOTS:
void setSelectionTool();
private:
QMdiArea *mdiArea;
class PlaYUVerMdiArea: public QMdiArea
{
public:
PlaYUVerMdiArea( QWidget *parent = 0 ) :
QMdiArea( parent ),
m_pixmap( ":/images/playuver-backgroud-logo.png" )
{
}
protected:
void paintEvent( QPaintEvent *event )
{
QMdiArea::paintEvent( event );
QPainter painter( viewport() );
// Calculate the logo position - the bottom right corner of the mdi area.
int x = width() / 2 - m_pixmap.width() / 2;
int y = height() / 2 - m_pixmap.height() / 2;
painter.drawPixmap( x, y, m_pixmap );
}
private:
// Store the logo image.
QPixmap m_pixmap;
};
//QMdiArea *mdiArea;
PlaYUVerMdiArea *mdiArea;
SubWindowHandle *m_pcCurrentSubWindow;
ModulesHandle *m_pcModulesHandle;
@@ -152,7 +179,6 @@ private:
static SubWindowHandle* findSubWindow( const QMdiArea* mdiArea, const QString& fileName );
static SubWindowHandle* findSubWindow( const QMdiArea* mdiArea, const SubWindowHandle* subWindow );
QVector<SubWindowHandle*> m_acPlayingSubWindows;
QSlider *m_pcFrameSlider;
QLabel *m_pcCurrFrameNumLabel;