From ea06220ddde0c6f70719aaccb5af9e59726cb029 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 7 Jun 2007 08:08:02 +0000 Subject: [PATCH] Porting to Qt 4 --- src/Qtx/QtxSplash.cxx | 18 +++++++++++++++++- src/Qtx/QtxSplash.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Qtx/QtxSplash.cxx b/src/Qtx/QtxSplash.cxx index eba6fd7b6..f99e36b2a 100644 --- a/src/Qtx/QtxSplash.cxx +++ b/src/Qtx/QtxSplash.cxx @@ -150,7 +150,7 @@ QtxSplash* QtxSplash::mySplash = 0; \param pixmap splash screen pixmap */ QtxSplash::QtxSplash( const QPixmap& pixmap ) -: QWidget( 0, Qt::SplashScreen ), +: QWidget( 0, Qt::SplashScreen | Qt::WindowStaysOnTopHint ), myAlignment( Qt::AlignBottom | Qt::AlignRight ), myColor( Qt::white ), myHideOnClick( false ), @@ -740,6 +740,22 @@ void QtxSplash::mousePressEvent( QMouseEvent* /*me*/ ) hide(); } +/*! + \brief Customize paint event. + + This function is implemented to work-around the Qt bug + on some Linux distribututions when the drawing on the + splash screen widget is not allowed. + + \param pe paint event (not used) +*/ +void QtxSplash::paintEvent( QPaintEvent* /*pe*/ ) +{ + QPainter p( this ); + QPixmap pix = palette().brush( backgroundRole() ).texture(); + p.drawPixmap( 0, 0, pix ); +} + /*! \brief Process custom event sent by setStatus() method. \param ce custom event diff --git a/src/Qtx/QtxSplash.h b/src/Qtx/QtxSplash.h index 4fe766991..bd952119b 100644 --- a/src/Qtx/QtxSplash.h +++ b/src/Qtx/QtxSplash.h @@ -121,6 +121,8 @@ public slots: protected: virtual void mousePressEvent( QMouseEvent* ); virtual void customEvent( QEvent* ); + virtual void paintEvent( QPaintEvent* ); + virtual void drawContents( QPainter* ); virtual void drawProgressBar( QPainter* ); -- 2.39.2