diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index 5de8be116c8..ac633f18855 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -196,28 +196,15 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \snippet qloggingcategory/main.cpp 3 */ -/*! - Constructs a QLoggingCategory object with the provided \a category name. - All message types for this category are enabled by default. - - If \a category is \c{0}, the category name is changed to \c "default". - - \note \a category must be kept valid during the lifetime of this object. -*/ -QLoggingCategory::QLoggingCategory(const char *category) - : d(nullptr), - name(nullptr) -{ - init(category, QtDebugMsg); -} - /*! Constructs a QLoggingCategory object with the provided \a category name, - and enables all messages with types more severe or equal than \a enableForLevel. + and enables all messages with types at least as verbose as \a enableForLevel, + which defaults to QtDebugMsg (which enables all categories). - If \a category is \c{0}, the category name is changed to \c "default". + If \a category is \nullptr, the category name \c "default" is used. \note \a category must be kept valid during the lifetime of this object. + Using a string literal for it is the usual way to achieve this. \since 5.4 */ diff --git a/src/corelib/io/qloggingcategory.h b/src/corelib/io/qloggingcategory.h index 1c3e10b493d..6e74a8c3be5 100644 --- a/src/corelib/io/qloggingcategory.h +++ b/src/corelib/io/qloggingcategory.h @@ -49,9 +49,7 @@ class Q_CORE_EXPORT QLoggingCategory { Q_DISABLE_COPY(QLoggingCategory) public: - // ### Qt 6: Merge constructors - explicit QLoggingCategory(const char *category); - QLoggingCategory(const char *category, QtMsgType severityLevel); + explicit QLoggingCategory(const char *category, QtMsgType severityLevel = QtDebugMsg); ~QLoggingCategory(); bool isEnabled(QtMsgType type) const;