diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-06 15:35:06 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-06 19:00:41 +0200 |
commit | 2a302a73613d68475e667f69b8e36ce07853c813 (patch) | |
tree | 06de55baaed993b51af517dba8f230fab749882c /src/corelib/kernel/qcoreapplication.cpp | |
parent | 5505d25be972948db1621e1511b89b4144aa8bfc (diff) | |
parent | dea7110b29c5c68a5b09454c968324042ed1b607 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: Iac12a37fa6536ebe30e6548f7c54ec0c402c9f5d
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index fc8b9227d4..865e16a3f0 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 <qdatastream.h> #include <qdebug.h> @@ -225,6 +226,13 @@ bool QCoreApplicationPrivate::checkInstance(const char *function) return b; } +void QCoreApplicationPrivate::addQtOptions(QList<QCommandLineOption> *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; @@ -690,7 +698,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. */ /*! @@ -952,6 +960,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) @@ -960,6 +972,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<Qt::ApplicationAttribute>().valueToKey(attribute)); +#endif + break; + default: + break; + } + } } /*! |