From af2daafde72db02454d24b7d691aa6861525ab99 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 18 Nov 2019 17:01:26 +0100 Subject: Deprecate constructing QFlags from a pointer This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/corelib/global/qglobal.cpp') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 4ab5bd2edb..d95cc786ab 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -250,7 +250,7 @@ Q_STATIC_ASSERT((std::is_same::value)); Qt::Alignment type is simply a typedef for QFlags. QLabel::setAlignment() takes a Qt::Alignment parameter, which means that any combination of - Qt::AlignmentFlag values, or 0, is legal: + Qt::AlignmentFlag values, or \c{{ }}, is legal: \snippet code/src_corelib_global_qglobal.cpp 0 @@ -317,11 +317,21 @@ Q_STATIC_ASSERT((std::is_same::value)); Constructs a QFlags object storing the \a flags. */ +/*! + \fn template QFlags::QFlags() + \since 5.15 + + Constructs a QFlags object with no flags set. +*/ + /*! \fn template QFlags::QFlags(Zero) + \deprecated Constructs a QFlags object with no flags set. The parameter must be a literal 0 value. + + Deprecated, use default constructor instead. */ /*! -- cgit v1.2.3