summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qloggingcategory.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2014-02-14 13:36:38 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-15 21:57:43 +0100
commitc9cdbcb12f80cd72905e49ce1a673eae9f559ca3 (patch)
tree86af8aff149ad481bec976ae9d1ac3fce92e7ed7 /src/corelib/io/qloggingcategory.cpp
parent0bb6b65c56f49b93ca367f6771f10d3320dfc4f4 (diff)
Add const overload for QLoggingCategory::operator()()
Change 85e57653 caused a compile error for code that does Q_DECLARE_LOGGING_CATEGORY(cat); //.. qCDebug(cat()) << // ... error: C3848: expression having type 'const QLoggingCategory' would lose some const-volatile qualifiers in order to call 'QLoggingCategory &QLoggingCategory::operator ()(void)' This is a regression from Qt 5.2. Fix the error by adding a const version of operator()(). Change-Id: I2fb04f2e155962adee0f98089fc5a159000bef56 Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qloggingcategory.cpp')
-rw-r--r--src/corelib/io/qloggingcategory.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp
index 168087659f..f37b9575aa 100644
--- a/src/corelib/io/qloggingcategory.cpp
+++ b/src/corelib/io/qloggingcategory.cpp
@@ -274,6 +274,14 @@ void QLoggingCategory::setEnabled(QtMsgType type, bool enable)
*/
/*!
+ \fn const QLoggingCategory &QLoggingCategory::operator()() const
+
+ Returns the object itself. This allows both a QLoggingCategory variable, and
+ a factory method returning a QLoggingCategory, to be used in \l qCDebug(),
+ \l qCWarning(), \l qCCritical() macros.
+ */
+
+/*!
Returns a pointer to the global category \c "default" that
is used e.g. by qDebug(), qWarning(), qCritical(), qFatal().