QCommandLineOption: purge deprecated API

Since 5.8: setHidden(), isHidden()
Part of the QCommandLineParser test also used setHidden().

Change-Id: I05a1c63ff3beb1167ed75632c1b71d7fff17f09e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Edward Welbourne 2020-07-16 15:17:31 +02:00
parent 555be46527
commit f12132ff23
3 changed files with 2 additions and 44 deletions

View File

@ -1,5 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
** Copyright (C) 2013 David Faure <faure@kde.org>
** Contact: https://www.qt.io/licensing/
@ -391,36 +392,6 @@ QStringList QCommandLineOption::defaultValues() const
return d->defaultValues;
}
#if QT_DEPRECATED_SINCE(5, 8)
/*!
Sets whether to hide this option in the user-visible help output.
All options are visible by default. Setting \a hide to true for
a particular option makes it internal, i.e. not listed in the help output.
\since 5.6
\obsolete Use setFlags(QCommandLineOption::HiddenFromHelp), QCommandLineOption::HiddenFromHelp
\sa isHidden
*/
void QCommandLineOption::setHidden(bool hide)
{
d->flags.setFlag(HiddenFromHelp, hide);
}
/*!
Returns true if this option is omitted from the help output,
false if the option is listed.
\since 5.6
\obsolete Use flags() & QCommandLineOption::HiddenFromHelp
\sa setHidden(), QCommandLineOption::HiddenFromHelp
*/
bool QCommandLineOption::isHidden() const
{
return d->flags & HiddenFromHelp;
}
#endif
/*!
Returns a set of flags that affect this command-line option.

View File

@ -1,5 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
** Contact: https://www.qt.io/licensing/
**
@ -91,14 +92,6 @@ public:
Flags flags() const;
void setFlags(Flags aflags);
#if QT_DEPRECATED_SINCE(5, 8)
QT_DEPRECATED_X("Use setFlags() with HiddenFromHelp")
void setHidden(bool hidden);
QT_DEPRECATED_X("Use flags() and HiddenFromHelp")
bool isHidden() const;
#endif
private:
QSharedDataPointer<QCommandLineOptionPrivate> d;
};

View File

@ -74,12 +74,6 @@ int main(int argc, char *argv[])
hiddenOption.setDescription(QStringLiteral("THIS SHOULD NEVER APPEAR"));
hiddenOption.setFlags(QCommandLineOption::HiddenFromHelp);
parser.addOption(hiddenOption);
#if QT_DEPRECATED_SINCE(5, 8)
QCommandLineOption hiddenOption2(QStringList() << QStringLiteral("hidden2"));
hiddenOption2.setDescription(QStringLiteral("NEITHER SHOULD THIS"));
hiddenOption2.setHidden(true);
parser.addOption(hiddenOption2);
#endif
// This program supports different options depending on the "command" (first argument).
// Call parse() to find out the positional arguments.