From 7906255ef2412168dc94768ec7f73ee41b159804 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 11 Feb 2016 13:17:04 +0100 Subject: doc: Clean up old references to QApplication for GUI application Since Qt 5.0, there's been a separation between QGuiApplication for generic GUI applications, and QApplication for applications using Qt Widgets. The docs in QCoreApplication has not reflected this, however, and was still recommending QApplication for any GUI app. Change-Id: I7b2b166170d1e20755889767cda3d555fbbc666a Reviewed-by: Martin Smith Reviewed-by: Nico Vertriest --- src/corelib/kernel/qcoreapplication.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 48d70f2747..6dcd0ed5b4 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -617,7 +617,8 @@ void QCoreApplicationPrivate::initLocale() This class is used by non-GUI applications to provide their event loop. For non-GUI application that uses Qt, there should be exactly one QCoreApplication object. For GUI applications, see - QApplication. + QGuiApplication. For applications that use the Qt Widgets module, + see QApplication. QCoreApplication contains the main event loop, where all events from the operating system (e.g., timer and network events) and @@ -631,10 +632,10 @@ void QCoreApplicationPrivate::initLocale() operations can call processEvents() to keep the application responsive. - In general, we recommend that you create a QCoreApplication or a - QApplication object in your \c main() function as early as - possible. exec() will not return until the event loop exits; e.g., - when quit() is called. + In general, we recommend that you create a QCoreApplication, + QGuiApplication or a QApplication object in your \c main() + function as early as possible. exec() will not return until + the event loop exits; e.g., when quit() is called. Several static convenience functions are also provided. The QCoreApplication object is available from instance(). Events can @@ -676,8 +677,8 @@ void QCoreApplicationPrivate::initLocale() instance, when converting between data types such as floats and strings, since the notation may differ between locales. To get around this problem, call the POSIX function \c{setlocale(LC_NUMERIC,"C")} - right after initializing QApplication or QCoreApplication to reset - the locale that is used for number formatting to "C"-locale. + right after initializing QApplication, QGuiApplication or QCoreApplication + to reset the locale that is used for number formatting to "C"-locale. \sa QGuiApplication, QAbstractEventDispatcher, QEventLoop, {Semaphores Example}, {Wait Conditions Example} @@ -687,7 +688,7 @@ void QCoreApplicationPrivate::initLocale() \fn static QCoreApplication *QCoreApplication::instance() Returns a pointer to the application's QCoreApplication (or - QApplication) instance. + QGuiApplication/QApplication) instance. If no instance has been allocated, \c null is returned. */ @@ -1868,7 +1869,7 @@ void QCoreApplication::quit() Installing or removing a QTranslator, or changing an installed QTranslator generates a \l{QEvent::LanguageChange}{LanguageChange} event for the - QCoreApplication instance. A QApplication instance will propagate the event + QCoreApplication instance. A QGuiApplication instance will propagate the event to all toplevel windows, where a reimplementation of changeEvent can re-translate the user interface by passing user-visible strings via the tr() function to the respective property setters. User-interface classes -- cgit v1.2.3 From 13034e67c0fa1a5ae1899dcb62869da42d84626f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 30 Jun 2015 22:01:17 +0200 Subject: Make public headers compile with -Wzero-as-null-pointer-constant ... or similar. This amends previous commits that converted the majority of cases. Task-number: QTBUG-45291 Change-Id: I219cdeddca7063a56efeb4fee0e5bb2cbdc7732b Reviewed-by: Lars Knoll Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/arch/qatomic_cxx11.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h index 4136e09ce2..baa3d65faf 100644 --- a/src/corelib/arch/qatomic_cxx11.h +++ b/src/corelib/arch/qatomic_cxx11.h @@ -144,7 +144,7 @@ template struct QAtomicOps static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; } template - static bool testAndSetRelaxed(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = 0) Q_DECL_NOTHROW + static bool testAndSetRelaxed(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW { bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed); if (currentValue) @@ -153,7 +153,7 @@ template struct QAtomicOps } template - static bool testAndSetAcquire(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = 0) Q_DECL_NOTHROW + static bool testAndSetAcquire(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW { bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire); if (currentValue) @@ -162,7 +162,7 @@ template struct QAtomicOps } template - static bool testAndSetRelease(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = 0) Q_DECL_NOTHROW + static bool testAndSetRelease(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW { bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release); if (currentValue) @@ -171,7 +171,7 @@ template struct QAtomicOps } template - static bool testAndSetOrdered(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = 0) Q_DECL_NOTHROW + static bool testAndSetOrdered(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW { bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel); if (currentValue) -- cgit v1.2.3