summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2020-01-09 20:30:39 +0100
committerLiang Qi <liang.qi@qt.io>2020-01-09 20:30:39 +0100
commita59c7684897bfbbb7ddcec2f05263fee92ab5056 (patch)
tree50793671569f87bdbfc0e9ff36adbf416971d6cf /src/gui
parent5507d0f1b04ea6b1d91be9ade30bc31d1830c220 (diff)
parent1c75f59588694557caba69c2fc173dd8f1d7f514 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: src/corelib/kernel/qobject.cpp Change-Id: I4780b25665672692b086ee92092e506c814642f2
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp19
-rw-r--r--src/gui/kernel/qguiapplication_p.h2
-rw-r--r--src/gui/kernel/qinputdevicemanager_p_p.h2
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp1
4 files changed, 18 insertions, 6 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 5757e67cfe..680c69a978 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -3289,12 +3289,8 @@ QPalette QGuiApplication::palette()
*/
void QGuiApplication::setPalette(const QPalette &pal)
{
- if (QGuiApplicationPrivate::app_pal && pal.isCopyOf(*QGuiApplicationPrivate::app_pal))
+ if (!QGuiApplicationPrivate::setPalette(pal))
return;
- if (!QGuiApplicationPrivate::app_pal)
- QGuiApplicationPrivate::app_pal = new QPalette(pal);
- else
- *QGuiApplicationPrivate::app_pal = pal;
QCoreApplication::setAttribute(Qt::AA_SetPalette);
@@ -3302,6 +3298,19 @@ void QGuiApplication::setPalette(const QPalette &pal)
qGuiApp->d_func()->sendApplicationPaletteChange();
}
+bool QGuiApplicationPrivate::setPalette(const QPalette &palette)
+{
+ if (app_pal && palette.isCopyOf(*app_pal))
+ return false;
+
+ if (!app_pal)
+ app_pal = new QPalette(palette);
+ else
+ *app_pal = palette;
+
+ return true;
+}
+
void QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(QWindow *window)
{
windowGeometrySpecification.applyTo(window);
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index ee493faa5d..2fe4ae02cf 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -323,6 +323,8 @@ public:
static void resetCachedDevicePixelRatio();
+ static bool setPalette(const QPalette &palette);
+
protected:
virtual void notifyThemeChanged();
virtual void sendApplicationPaletteChange(bool toAllWidgets = false, const char *className = nullptr);
diff --git a/src/gui/kernel/qinputdevicemanager_p_p.h b/src/gui/kernel/qinputdevicemanager_p_p.h
index 871f9315c3..82a86446a0 100644
--- a/src/gui/kernel/qinputdevicemanager_p_p.h
+++ b/src/gui/kernel/qinputdevicemanager_p_p.h
@@ -69,7 +69,7 @@ public:
int deviceCount(QInputDeviceManager::DeviceType type) const;
void setDeviceCount(QInputDeviceManager::DeviceType type, int count);
- std::array<int, QInputDeviceManager::NumDeviceTypes> m_deviceCount;
+ std::array<int, QInputDeviceManager::NumDeviceTypes> m_deviceCount = {};
Qt::KeyboardModifiers keyboardModifiers;
};
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index a82edbb073..b53c9a3eab 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -1330,6 +1330,7 @@ void QOpenGL2PaintEngineExPrivate::drawVertexArrays(const float *data, int *stop
QOpenGL2PaintEngineEx::QOpenGL2PaintEngineEx()
: QPaintEngineEx(*(new QOpenGL2PaintEngineExPrivate(this)))
{
+ gccaps &= ~QPaintEngine::RasterOpModes;
}
QOpenGL2PaintEngineEx::~QOpenGL2PaintEngineEx()