forked from videolan/vlc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Qt: don't try to show an uninitialized time tooltip
Signed-off-by: Jean-Baptiste Kempf <[email protected]>
- Loading branch information
Showing
2 changed files
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/***************************************************************************** | ||
* Copyright © 2011 VideoLAN | ||
* Copyright © 2011-2012 VideoLAN | ||
* $Id$ | ||
* | ||
* Authors: Ludovic Fauvet <[email protected]> | ||
|
@@ -31,7 +31,7 @@ | |
#define TIP_HEIGHT 5 | ||
|
||
TimeTooltip::TimeTooltip( QWidget *parent ) : | ||
QWidget( parent ) | ||
QWidget( parent ), mInitialized( false ) | ||
{ | ||
setWindowFlags( Qt::Window | | ||
Qt::WindowStaysOnTopHint | | ||
|
@@ -123,6 +123,7 @@ void TimeTooltip::buildPath() | |
|
||
void TimeTooltip::setTip( const QPoint& target, const QString& time, const QString& text ) | ||
{ | ||
mInitialized = true; | ||
mDisplayedText = time; | ||
if ( !text.isEmpty() ) | ||
mDisplayedText.append( " - " ).append( text ); | ||
|
@@ -138,6 +139,11 @@ void TimeTooltip::setTip( const QPoint& target, const QString& time, const QStri | |
update(); | ||
} | ||
|
||
void TimeTooltip::show() | ||
{ | ||
QWidget::setVisible( mInitialized ); | ||
} | ||
|
||
void TimeTooltip::paintEvent( QPaintEvent * ) | ||
{ | ||
QPainter p( this ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters