From 69f6cab0af78285472deb8d91c862c600685e618 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 28 Apr 2019 12:52:19 +0200 Subject: Doc: replace even more null/0/nullptr with \nullptr macro Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also checked for 'null pointer' and similar. Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a Reviewed-by: Edward Welbourne --- src/corelib/kernel/qcoreapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel/qcoreapplication.cpp') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 69b2a9bf41..9a3d5c6ef4 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -699,7 +699,7 @@ void QCoreApplicationPrivate::initLocale() Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance. - If no instance has been allocated, \c null is returned. + If no instance has been allocated, \nullptr is returned. */ /*! -- cgit v1.2.3 From e9e16c7464364fd15f69e3f37a9ed3edb15b633b Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 3 Dec 2018 17:00:53 +0000 Subject: Warn when setting attributes after QCoreApplication is created It's a recurring bug seen in user code and a warning will help reduce it. Warns only for the attributes that have such requirement in the docs, but maybe we should be more strict and warn for any attribute. Change-Id: I68148521953221ad0e8be1028181f52a7f22d2cc Reviewed-by: Giuseppe D'Angelo --- src/corelib/kernel/qcoreapplication.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/corelib/kernel/qcoreapplication.cpp') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index e5f39a8d35..8652c45634 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -46,6 +46,7 @@ #include "qcoreevent.h" #include "qeventloop.h" #endif +#include "qmetaobject.h" #include "qcorecmdlineargs_p.h" #include #include @@ -966,6 +967,10 @@ bool QCoreApplication::isSetuidAllowed() Sets the attribute \a attribute if \a on is true; otherwise clears the attribute. + \note Some application attributes must be set \b before creating a + QCoreApplication instance. Refer to the Qt::ApplicationAttribute + documentation for more information. + \sa testAttribute() */ void QCoreApplication::setAttribute(Qt::ApplicationAttribute attribute, bool on) @@ -974,6 +979,27 @@ void QCoreApplication::setAttribute(Qt::ApplicationAttribute attribute, bool on) QCoreApplicationPrivate::attribs |= 1 << attribute; else QCoreApplicationPrivate::attribs &= ~(1 << attribute); + if (Q_UNLIKELY(qApp)) { + switch (attribute) { + case Qt::AA_EnableHighDpiScaling: + case Qt::AA_DisableHighDpiScaling: + case Qt::AA_PluginApplication: + case Qt::AA_UseDesktopOpenGL: + case Qt::AA_UseOpenGLES: + case Qt::AA_UseSoftwareOpenGL: + case Qt::AA_ShareOpenGLContexts: +#ifdef QT_BOOTSTRAPPED + qWarning("Attribute %d must be set before QCoreApplication is created.", + attribute); +#else + qWarning("Attribute Qt::%s must be set before QCoreApplication is created.", + QMetaEnum::fromType().valueToKey(attribute)); +#endif + break; + default: + break; + } + } } /*! -- cgit v1.2.3 From 341c8b9cd08c1cd863cf8581a825561a2862fce2 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 15 May 2019 15:28:18 +0200 Subject: QCommandLineParser: add --help-all, to show Qt options as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sample output at http://www.kdab.com/~dfaure/2019/help-all-example.txt Fixes: QTBUG-41802 Change-Id: I7a3350200761d41481fcb10ec4328e96e548d246 Reviewed-by: André Hartmann Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreapplication.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/corelib/kernel/qcoreapplication.cpp') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index b70c61e351..72aaac44a6 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -226,6 +226,13 @@ bool QCoreApplicationPrivate::checkInstance(const char *function) return b; } +void QCoreApplicationPrivate::addQtOptions(QList *options) +{ + options->append(QCommandLineOption(QStringLiteral("qmljsdebugger"), + QStringLiteral("Activates the QML/JS debugger with a specified port. The value must be of format port:1234[,block]. \"block\" makes the application wait for a connection."), + QStringLiteral("value"))); +} + void QCoreApplicationPrivate::processCommandLineArguments() { int j = argc ? 1 : 0; -- cgit v1.2.3