From 0e0c351fff752ceadc99eef5fbcf5a180f453efc Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 3 Mar 2016 10:45:35 +0100 Subject: Make public headers compile with -Wzero-as-null-pointer-constant ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Task-number: QTBUG-45291 Change-Id: Ied526fb2d7adc3a68946d6843a6bd6f475ebf864 Reviewed-by: Lars Knoll --- src/quickwidgets/qquickwidget.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quickwidgets') diff --git a/src/quickwidgets/qquickwidget.h b/src/quickwidgets/qquickwidget.h index 5bb6b49a49..236a4a9c27 100644 --- a/src/quickwidgets/qquickwidget.h +++ b/src/quickwidgets/qquickwidget.h @@ -58,9 +58,9 @@ class Q_QUICKWIDGETS_EXPORT QQuickWidget : public QWidget Q_PROPERTY(QUrl source READ source WRITE setSource DESIGNABLE true) public: - explicit QQuickWidget(QWidget *parent = 0); + explicit QQuickWidget(QWidget *parent = Q_NULLPTR); QQuickWidget(QQmlEngine* engine, QWidget *parent); - QQuickWidget(const QUrl &source, QWidget *parent = 0); + QQuickWidget(const QUrl &source, QWidget *parent = Q_NULLPTR); virtual ~QQuickWidget(); QUrl source() const; -- cgit v1.2.3 From 998036e9de667ae7b456c96855af4e542738e33c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 3 Mar 2016 10:49:02 +0100 Subject: Make more ctors explicit Added explicit where it was missing. This is not a source- incompatible change, because code that breaks by this is a bug. Let's not have this sitting around in an LTS. Change-Id: Ic198750717799126b4e37817845a8ee4684d631f Reviewed-by: Lars Knoll --- src/quickwidgets/qquickwidget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quickwidgets') diff --git a/src/quickwidgets/qquickwidget.h b/src/quickwidgets/qquickwidget.h index 236a4a9c27..53d3c16533 100644 --- a/src/quickwidgets/qquickwidget.h +++ b/src/quickwidgets/qquickwidget.h @@ -60,7 +60,7 @@ class Q_QUICKWIDGETS_EXPORT QQuickWidget : public QWidget public: explicit QQuickWidget(QWidget *parent = Q_NULLPTR); QQuickWidget(QQmlEngine* engine, QWidget *parent); - QQuickWidget(const QUrl &source, QWidget *parent = Q_NULLPTR); + explicit QQuickWidget(const QUrl &source, QWidget *parent = Q_NULLPTR); virtual ~QQuickWidget(); QUrl source() const; -- cgit v1.2.3 From 02ebc8ba89be301a8bb8761142ec629b27a1493f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 29 Mar 2016 14:20:20 +0200 Subject: Add a note saying that QQuickWidget::rootObject can return null Change-Id: Ia5db63c39287d23c3ed279aa5671a9e7bc7b26c0 Reviewed-by: Gunnar Sletta --- src/quickwidgets/qquickwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/quickwidgets') diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 83e617f8e4..f720513b85 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -986,7 +986,9 @@ QSize QQuickWidget::initialSize() const } /*! - Returns the view's root \l {QQuickItem} {item}. + Returns the view's root \l {QQuickItem} {item}. Can be null + when setContents/setSource has not been called, if they were called with + broken QtQuick code or while the QtQuick contents are being created. */ QQuickItem *QQuickWidget::rootObject() const { -- cgit v1.2.3