Add setPalette to QGuiApplication

If we have a getter, we also need the setter to be
symmetric.

Change-Id: Ibcb20d66c711e4c1bebd448781fa9eddb9cd773f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
bb10
Lars Knoll 2012-01-12 14:23:57 +01:00 committed by Qt by Nokia
parent 84cad0bfc6
commit d613f30bd4
2 changed files with 11 additions and 0 deletions

View File

@ -1185,6 +1185,16 @@ QPalette QGuiApplication::palette()
return *QGuiApplicationPrivate::app_pal;
}
void QGuiApplication::setPalette(const QPalette &pal)
{
if (QGuiApplicationPrivate::app_pal && pal.isCopyOf(*QGuiApplicationPrivate::app_pal))
return;
if (!QGuiApplicationPrivate::app_pal)
QGuiApplicationPrivate::app_pal = new QPalette(pal);
else
*QGuiApplicationPrivate::app_pal = pal;
}
QFont QGuiApplication::font()
{
QMutexLocker locker(applicationFontMutex());

View File

@ -108,6 +108,7 @@ public:
#endif
static QPalette palette();
static void setPalette(const QPalette &pal);
static Qt::KeyboardModifiers keyboardModifiers();
static Qt::MouseButtons mouseButtons();