Add background image support. Create a custom QMdiArea to handle it
This commit is contained in:
1 parent
a5a9b7e044
commit
623d2e78d3
4 files changed
+31
-3
No files matched your search
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user