]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to Qt 4
authorvsr <vsr@opencascade.com>
Thu, 7 Jun 2007 08:08:02 +0000 (08:08 +0000)
committervsr <vsr@opencascade.com>
Thu, 7 Jun 2007 08:08:02 +0000 (08:08 +0000)
src/Qtx/QtxSplash.cxx
src/Qtx/QtxSplash.h

index eba6fd7b6ed50b85d43fe87934033d225f9cb905..f99e36b2ae978685af19a7381fc58cbf828db343 100644 (file)
@@ -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
index 4fe76699148b5bb338ae688e3d97752cb861ff0b..bd952119b1b817fecb4ba4e8d33f431aa27ca1bd 100644 (file)
@@ -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* );