summaryrefslogtreecommitdiffstats
path: root/src/widgets/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/widgets/kernel
parentfe29a6a6ebbf28505df7cdf1de24fa540fd3745e (diff)
parentb1092a7d4240d419cc2b5f3f5c326a1cb680bbdd (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp42
-rw-r--r--src/widgets/kernel/qapplication_p.h3
-rw-r--r--src/widgets/kernel/qformlayout.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp4
4 files changed, 27 insertions, 24 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 595bdf621d..53e1d13455 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -360,7 +360,7 @@ void QApplicationPrivate::createEventDispatcher()
/*!
\fn QWidget *QApplication::topLevelAt(const QPoint &point)
- Returns the top-level widget at the given \a point; returns 0 if
+ Returns the top-level widget at the given \a point; returns \nullptr if
there is no such widget.
*/
QWidget *QApplication::topLevelAt(const QPoint &pos)
@@ -1226,7 +1226,7 @@ void QApplication::setStyle(QStyle *style)
"windows", "windowsvista", "fusion", or "macintosh". Style
names are case insensitive.
- Returns 0 if an unknown \a style is passed, otherwise the QStyle object
+ Returns \nullptr if an unknown \a style is passed, otherwise the QStyle object
returned is set as the application's GUI style.
\warning To ensure that the application's style is set correctly, it is
@@ -1420,24 +1420,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) {
// Send ApplicationPaletteChange to qApp itself, and to the widgets.
- QEvent e(QEvent::ApplicationPaletteChange);
- QApplication::sendEvent(QApplication::instance(), &e);
-
- QWidgetList wids = QApplication::allWidgets();
- for (QWidgetList::ConstIterator it = wids.constBegin(), cend = wids.constEnd(); it != cend; ++it) {
- QWidget *w = *it;
- if (all || (!className && w->isWindow()) || w->inherits(className)) // matching class
- QApplication::sendEvent(w, &e);
- }
-
- // Send to all scenes as well.
-#if QT_CONFIG(graphicsview)
- QList<QGraphicsScene *> &scenes = qApp->d_func()->scene_list;
- for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin();
- it != scenes.constEnd(); ++it) {
- QApplication::sendEvent(*it, &e);
- }
-#endif // QT_CONFIG(graphicsview)
+ qApp->d_func()->sendApplicationPaletteChange(all, className);
}
if (!className && (!QApplicationPrivate::sys_pal || !palette.isCopyOf(*QApplicationPrivate::sys_pal))) {
if (!QApplicationPrivate::set_pal)
@@ -2195,7 +2178,7 @@ void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous)
/*!internal
* Helper function that returns the new focus widget, but does not set the focus reason.
- * Returns 0 if a new focus widget could not be found.
+ * Returns \nullptr if a new focus widget could not be found.
* Shared with QGraphicsProxyWidgetPrivate::findFocusChild()
*/
QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next,
@@ -4511,6 +4494,23 @@ void QApplicationPrivate::notifyThemeChanged()
qt_init_tooltip_palette();
}
+void QApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className)
+{
+ QGuiApplicationPrivate::sendApplicationPaletteChange();
+
+ QEvent event(QEvent::ApplicationPaletteChange);
+ const QWidgetList widgets = QApplication::allWidgets();
+ for (auto widget : widgets) {
+ if (toAllWidgets || (!className && widget->isWindow()) || (className && widget->inherits(className)))
+ QApplication::sendEvent(widget, &event);
+ }
+
+#if QT_CONFIG(graphicsview)
+ for (auto scene : qAsConst(scene_list))
+ QApplication::sendEvent(scene, &event);
+#endif // QT_CONFIG(graphicsview)
+}
+
#if QT_CONFIG(draganddrop)
void QApplicationPrivate::notifyDragStarted(const QDrag *drag)
{
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 05bc2468c1..133279f977 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -177,6 +177,9 @@ public:
protected:
void notifyThemeChanged() override;
+ void sendApplicationPaletteChange(bool toAllWidgets = false,
+ const char *className = nullptr) override;
+
#if QT_CONFIG(draganddrop)
void notifyDragStarted(const QDrag *) override;
#endif // QT_CONFIG(draganddrop)
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index 7cdddf3133..bd0ea2598a 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1827,7 +1827,7 @@ int QFormLayout::rowCount() const
/*!
Returns the layout item in the given \a row with the specified \a
- role (column). Returns 0 if there is no such item.
+ role (column). Returns \nullptr if there is no such item.
\sa QLayout::itemAt(), setItem()
*/
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 396a3bcf07..6616cb6de3 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -10412,7 +10412,7 @@ bool QWidget::hasHeightForWidth() const
Returns the visible child widget at the position (\a{x}, \a{y})
in the widget's coordinate system. If there is no visible child
- widget at the specified position, the function returns 0.
+ widget at the specified position, the function returns \nullptr.
*/
/*!
@@ -12376,7 +12376,7 @@ Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget)
\since 4.5
Returns the proxy widget for the corresponding embedded widget in a graphics
- view; otherwise returns 0.
+ view; otherwise returns \nullptr.
\sa QGraphicsProxyWidget::createProxyForChildWidget(),
QGraphicsScene::addWidget()