Commit 697766fe authored by Ludovic Fauvet's avatar Ludovic Fauvet

Qt: raise the tooltip so it stays in front of the fullscreen controller

parent 9653db32
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define TIP_HEIGHT 5 #define TIP_HEIGHT 5
TimeTooltip::TimeTooltip( QWidget *parent ) : TimeTooltip::TimeTooltip( QWidget *parent ) :
QWidget( parent ), mInitialized( false ) QWidget( parent )
{ {
setWindowFlags( Qt::Window | setWindowFlags( Qt::Window |
Qt::WindowStaysOnTopHint | Qt::WindowStaysOnTopHint |
...@@ -132,7 +132,6 @@ void TimeTooltip::buildPath() ...@@ -132,7 +132,6 @@ void TimeTooltip::buildPath()
void TimeTooltip::setTip( const QPoint& target, const QString& time, const QString& text ) void TimeTooltip::setTip( const QPoint& target, const QString& time, const QString& text )
{ {
mInitialized = true;
mDisplayedText = time; mDisplayedText = time;
if ( !text.isEmpty() ) if ( !text.isEmpty() )
mDisplayedText.append( " - " ).append( text ); mDisplayedText.append( " - " ).append( text );
...@@ -146,18 +145,13 @@ void TimeTooltip::setTip( const QPoint& target, const QString& time, const QStri ...@@ -146,18 +145,13 @@ void TimeTooltip::setTip( const QPoint& target, const QString& time, const QStri
} }
update(); update();
raise();
} }
void TimeTooltip::show() void TimeTooltip::show()
{ {
setVisible( true ); setVisible( true );
#ifdef Q_OS_OS2 raise();
// Bring a tooltip on the top
// Without this, tooltip does not appear on fullscreen
// from the second fullscreen state change
if( mInitialized )
QWidget::raise();
#endif
} }
void TimeTooltip::paintEvent( QPaintEvent * ) void TimeTooltip::paintEvent( QPaintEvent * )
......
...@@ -54,7 +54,6 @@ private: ...@@ -54,7 +54,6 @@ private:
QPainterPath mPainterPath; QPainterPath mPainterPath;
QBitmap mMask; QBitmap mMask;
int mTipX; int mTipX;
bool mInitialized;
}; };
#endif // TIMETOOLTIP_H #endif // TIMETOOLTIP_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment