summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-21 13:03:09 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-21 13:03:09 +0100
commitf94ca82e0ff6345648b499911411f2dcc1849267 (patch)
treebc5acac8bfecaf5bccc612f5b009bf249bc69ef1 /src/gui/kernel
parentfe29a6a6ebbf28505df7cdf1de24fa540fd3745e (diff)
parentb1092a7d4240d419cc2b5f3f5c326a1cb680bbdd (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qevent.cpp4
-rw-r--r--src/gui/kernel/qguiapplication.cpp14
-rw-r--r--src/gui/kernel/qguiapplication_p.h1
-rw-r--r--src/gui/kernel/qopenglcontext.cpp2
-rw-r--r--src/gui/kernel/qplatformcursor.cpp2
-rw-r--r--src/gui/kernel/qplatformintegration.cpp2
-rw-r--r--src/gui/kernel/qplatformscreen.cpp2
-rw-r--r--src/gui/kernel/qwindow.cpp4
8 files changed, 23 insertions, 8 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 53d1ac1fc0..7123c4d8ba 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3072,7 +3072,7 @@ QDropEvent::~QDropEvent()
/*!
If the source of the drag operation is a widget in this
application, this function returns that source; otherwise it
- returns 0. The source of the operation is the first parameter to
+ returns \nullptr. The source of the operation is the first parameter to
the QDrag object used instantiate the drag.
This is useful if your widget needs special behavior when dragging
@@ -3514,7 +3514,7 @@ QActionEvent::~QActionEvent()
\fn QAction *QActionEvent::before() const
If type() is \l ActionAdded, returns the action that should
- appear before action(). If this function returns 0, the action
+ appear before action(). If this function returns \nullptr, the action
should be appended to already existing actions on the same
widget.
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 8f4c674952..4a0febc615 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -3755,7 +3755,7 @@ Qt::LayoutDirection QGuiApplication::layoutDirection()
Returns the active application override cursor.
- This function returns 0 if no application cursor has been defined (i.e. the
+ This function returns \nullptr if no application cursor has been defined (i.e. the
internal cursor stack is empty).
\sa setOverrideCursor(), restoreOverrideCursor()
@@ -3991,6 +3991,9 @@ void QGuiApplicationPrivate::notifyThemeChanged()
!QCoreApplication::testAttribute(Qt::AA_SetPalette)) {
clearPalette();
initPalette();
+ emit qGuiApp->paletteChanged(*app_pal);
+ if (is_app_running && !is_app_closing)
+ sendApplicationPaletteChange();
}
if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) {
QMutexLocker locker(&applicationFontMutex);
@@ -3999,6 +4002,15 @@ void QGuiApplicationPrivate::notifyThemeChanged()
}
}
+void QGuiApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className)
+{
+ Q_UNUSED(toAllWidgets)
+ Q_UNUSED(className)
+
+ QEvent event(QEvent::ApplicationPaletteChange);
+ QGuiApplication::sendEvent(QGuiApplication::instance(), &event);
+}
+
#if QT_CONFIG(draganddrop)
void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag)
{
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index a5f3f99a31..63646dcd50 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -315,6 +315,7 @@ public:
protected:
virtual void notifyThemeChanged();
+ virtual void sendApplicationPaletteChange(bool toAllWidgets = false, const char *className = nullptr);
bool tryCloseRemainingWindows(QWindowList processedWindows);
#if QT_CONFIG(draganddrop)
virtual void notifyDragStarted(const QDrag *);
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index c5d5490ea0..be04513de6 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -1118,7 +1118,7 @@ void QOpenGLContext::swapBuffers(QSurface *surface)
/*!
Resolves the function pointer to an OpenGL extension function, identified by \a procName
- Returns 0 if no such function can be found.
+ Returns \nullptr if no such function can be found.
*/
QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName) const
{
diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp
index bab26f6028..76e38ab12d 100644
--- a/src/gui/kernel/qplatformcursor.cpp
+++ b/src/gui/kernel/qplatformcursor.cpp
@@ -84,7 +84,7 @@ QT_BEGIN_NAMESPACE
\a windowCursor is a pointer to the QCursor that should be displayed.
- To unset the cursor of \a window, 0 is passed. This means \a window does not have
+ To unset the cursor of \a window, \nullptr is passed. This means \a window does not have
a cursor set and the cursor of a the first parent window which has a cursor explicitly
set or the system default cursor should take effect.
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index bff1c907d6..bb20a160db 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -350,7 +350,7 @@ void QPlatformIntegration::destroy()
/*!
Returns the platforms input context.
- The default implementation returns 0, implying no input method support.
+ The default implementation returns \nullptr, implying no input method support.
*/
QPlatformInputContext *QPlatformIntegration::inputContext() const
{
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index 9614be7f3e..b7b312e89e 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -370,7 +370,7 @@ QString QPlatformScreen::serialNumber() const
/*!
Reimplement this function in subclass to return the cursor of the screen.
- The default implementation returns 0.
+ The default implementation returns \nullptr.
*/
QPlatformCursor *QPlatformScreen::cursor() const
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 944e7d6139..c85f6a118d 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2599,6 +2599,8 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
return;
Q_Q(QWindow);
+ if (!q->isTopLevel())
+ return;
// Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent
bool quitOnClose = QGuiApplication::quitOnLastWindowClosed() && !q->parent();
QWindowList list = QGuiApplication::topLevelWindows();
@@ -2655,7 +2657,7 @@ QOpenGLContext *QWindowPrivate::shareContext() const
native window, or to embed a native window inside a QWindow.
If foreign windows are not supported or embedding the native window
- failed in the platform plugin, this function returns 0.
+ failed in the platform plugin, this function returns \nullptr.
\note The resulting QWindow should not be used to manipulate the underlying
native window (besides re-parenting), or to observe state changes of the