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
parent
dda9b5325f
commit
6ddcfcdcbe
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue