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
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
@@ -1,6 +1,8 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource>
|
<qresource>
|
||||||
<file alias="images/playuver.png">icons/playuver.png</file>
|
<file alias="images/playuver.png">icons/playuver.png</file>
|
||||||
|
<file alias="images/playuver-backgroud-logo.png">playuver-background-logo.png</file>
|
||||||
|
|
||||||
<file alias="images/open.png">icons/open.png</file>
|
<file alias="images/open.png">icons/open.png</file>
|
||||||
<file alias="images/save.png">icons/save.png</file>
|
<file alias="images/save.png">icons/save.png</file>
|
||||||
<file alias="images/close.png">icons/close.png</file>
|
<file alias="images/close.png">icons/close.png</file>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ plaYUVerApp::plaYUVerApp()
|
|||||||
|
|
||||||
setWindowModality( Qt::ApplicationModal );
|
setWindowModality( Qt::ApplicationModal );
|
||||||
|
|
||||||
mdiArea = new QMdiArea;
|
mdiArea = new PlaYUVerMdiArea;
|
||||||
setCentralWidget( mdiArea );
|
setCentralWidget( mdiArea );
|
||||||
//mdiArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
//mdiArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
||||||
//mdiArea->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
//mdiArea->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
||||||
|
|||||||
@@ -113,7 +113,34 @@ private Q_SLOTS:
|
|||||||
void setSelectionTool();
|
void setSelectionTool();
|
||||||
|
|
||||||
private:
|
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;
|
SubWindowHandle *m_pcCurrentSubWindow;
|
||||||
ModulesHandle *m_pcModulesHandle;
|
ModulesHandle *m_pcModulesHandle;
|
||||||
|
|
||||||
@@ -152,7 +179,6 @@ private:
|
|||||||
static SubWindowHandle* findSubWindow( const QMdiArea* mdiArea, const QString& fileName );
|
static SubWindowHandle* findSubWindow( const QMdiArea* mdiArea, const QString& fileName );
|
||||||
static SubWindowHandle* findSubWindow( const QMdiArea* mdiArea, const SubWindowHandle* subWindow );
|
static SubWindowHandle* findSubWindow( const QMdiArea* mdiArea, const SubWindowHandle* subWindow );
|
||||||
|
|
||||||
|
|
||||||
QVector<SubWindowHandle*> m_acPlayingSubWindows;
|
QVector<SubWindowHandle*> m_acPlayingSubWindows;
|
||||||
QSlider *m_pcFrameSlider;
|
QSlider *m_pcFrameSlider;
|
||||||
QLabel *m_pcCurrFrameNumLabel;
|
QLabel *m_pcCurrFrameNumLabel;
|
||||||
|
|||||||
Reference in new issue
Block a user