[Development] Use QT_DEPRECATED_SINCE macro for specific enum values

Smith Martin Martin.Smith at theqtcompany.com
Thu Aug 13 12:19:29 CEST 2015

But it has actually been used to deprecate single enum values. Here is an example from QTextFormat:

class Q_GUI_EXPORT QTextFormat
    enum FormatType {
        InvalidFormat = -1,
        BlockFormat = 1,
        CharFormat = 2,
        ListFormat = 3,
        TableFormat = 4,
        FrameFormat = 5,

        UserFormat = 100
    \enum QTextFormat::FormatType

    This enum describes the text item a QTextFormat object is formatting.

    \value InvalidFormat An invalid format as created by the default
    \value BlockFormat The object formats a text block
    \value CharFormat The object formats a single character
    \value ListFormat The object formats a list
    \omitvalue TableFormat Unused Value, a table's FormatType is FrameFormat.
    \value FrameFormat The object formats a frame

    \value UserFormat

    \sa QTextCharFormat, QTextBlockFormat, QTextListFormat,
    QTextTableFormat, type()

From: development-bounces+martin.smith=theqtcompany.com at qt-project.org <development-bounces+martin.smith=theqtcompany.com at qt-project.org> on behalf of Thiago Macieira <thiago.macieira at intel.com>
Sent: Wednesday, August 12, 2015 11:06 PM
To: development at qt-project.org
Subject: Re: [Development] Use QT_DEPRECATED_SINCE macro for specific enum      values

On Wednesday 12 August 2015 22:12:43 Denis Shienkov wrote:
> So, my question is: how to deprecate the specific enum value with a
> right way for all compilers/platforms?

Don't do it. There's no portable way yet. Maybe in a year or two we can
introduce a macro for it.
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Development mailing list
Development at qt-project.org

More information about the Development mailing list