[vlc-commits] Qt: fix a visibility issue within the time tooltip

Ludovic Fauvet git at videolan.org
Wed Jul 17 16:30:16 CEST 2013


vlc/vlc-2.0 | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Jul 17 13:43:04 2013 +0200| [e3f22512fadb43dce5573f4515f1ca5d1677d3a1] | committer: Ludovic Fauvet

Qt: fix a visibility issue within the time tooltip

The first show() was never satisfied because the widget was not
initialized at this point.

(cherry picked from commit 9653db32b9670e25c587cb0308b7aef97aa08f7f)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=e3f22512fadb43dce5573f4515f1ca5d1677d3a1
---

 modules/gui/qt4/util/timetooltip.cpp |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/util/timetooltip.cpp b/modules/gui/qt4/util/timetooltip.cpp
index 281b383..3039750 100644
--- a/modules/gui/qt4/util/timetooltip.cpp
+++ b/modules/gui/qt4/util/timetooltip.cpp
@@ -57,10 +57,19 @@ TimeTooltip::TimeTooltip( QWidget *parent ) :
     setText( "00:00:00", "" );
 
     mInitialized = false;
+
+    // By default the widget is unintialized and should not be displayed
+    resize( 0, 0 );
 }
 
 void TimeTooltip::buildPath()
 {
+    if( mDisplayedText.isEmpty() )
+    {
+        resize( 0, 0 );
+        return;
+    }
+
     QFontMetrics metrics( mFont );
 
     // Get the bounding box required to print the text and add some padding
@@ -125,7 +134,7 @@ void TimeTooltip::setText( const QString& time, const QString& text )
 
 void TimeTooltip::show()
 {
-    QWidget::setVisible( mInitialized );
+    setVisible( true );
 #ifdef Q_WS_PM
     // Bring a tooltip on the top
     // Without this, tooltip does not appear on fullscreen



More information about the vlc-commits mailing list