QStringList: inherit the constructors from QList

Otherwise it would be missing some, e.g. QStringList(qsizetype).

Change-Id: I5214672e62c98514b37b09d283e6035c799eda99
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Giuseppe D'Angelo 2020-08-24 11:45:35 +02:00
parent aed0f34786
commit 33218bac1b
2 changed files with 1 additions and 28 deletions

View File

@ -184,12 +184,6 @@ QT_BEGIN_NAMESPACE
\sa QString
*/
/*!
\fn QStringList::QStringList()
Constructs an empty string list.
*/
/*!
\fn QStringList::QStringList(const QString &str)
@ -721,21 +715,4 @@ qsizetype QtPrivate::QStringList_removeDuplicates(QStringList *that)
return n - j;
}
/*! \fn QStringList::QStringList(std::initializer_list<QString> args)
\since 4.8
Construct a list from a std::initializer_list given by \a args.
This constructor is only enabled if the compiler supports C++11 initializer
lists.
*/
/*! \fn template<typename InputIterator> QStringList::QStringList(InputIterator first, InputIterator last)
\since 5.14
Constructs a QStringList with the contents in the iterator range [\a first, \a last).
The value type of \c InputIterator must be convertible to \c QString.
*/
QT_END_NAMESPACE

View File

@ -105,14 +105,10 @@ class QStringList : public QList<QString>
{
#endif
public:
inline QStringList() noexcept { }
using QList<QString>::QList;
inline explicit QStringList(const QString &i) { append(i); }
inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
inline QStringList(QList<QString> &&l) noexcept : QList<QString>(std::move(l)) { }
inline QStringList(std::initializer_list<QString> args) : QList<QString>(args) { }
template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
inline QStringList(InputIterator first, InputIterator last)
: QList<QString>(first, last) { }
QStringList &operator=(const QList<QString> &other)
{ QList<QString>::operator=(other); return *this; }