Update tooltip palette when receiving a theme change notification.

Task-number: QTBUG-38183
Change-Id: Ia86ae698ae4afcf9d5c361f178f3ca44ae9a3ee5
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
bb10
Friedemann Kleint 2014-04-16 16:55:20 +02:00 committed by The Qt Project
parent dda9b5325f
commit 6ddcfcdcbe
2 changed files with 11 additions and 4 deletions

View File

@ -368,6 +368,7 @@ QApplicationPrivate::~QApplicationPrivate()
void qt_init(QApplicationPrivate *priv, int type
);
void qt_init_tooltip_palette();
void qt_cleanup();
QStyle *QApplicationPrivate::app_style = 0; // default application style
@ -4025,6 +4026,7 @@ void QApplicationPrivate::notifyThemeChanged()
QGuiApplicationPrivate::notifyThemeChanged();
clearSystemPalette();
initSystemPalette();
qt_init_tooltip_palette();
}
#ifndef QT_NO_DRAGANDDROP

View File

@ -442,6 +442,14 @@ void QApplication::alert(QWidget *widget, int duration)
}
}
void qt_init_tooltip_palette()
{
#ifndef QT_NO_TOOLTIP
if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
QToolTip::setPalette(*toolTipPalette);
#endif
}
void qt_init(QApplicationPrivate *priv, int type)
{
Q_UNUSED(priv);
@ -449,10 +457,7 @@ void qt_init(QApplicationPrivate *priv, int type)
QColormap::initialize();
#ifndef QT_NO_TOOLTIP
if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
QToolTip::setPalette(*toolTipPalette);
#endif
qt_init_tooltip_palette();
QApplicationPrivate::initializeWidgetFontHash();
}