forked from qt-creator/qt-creator
Utils: Add toSet/toList functions
As replacement for functionality that's being deprecated in Qt but still useful or needed, or that cannot easily be handled without resorting to #if QT_VERSION checks in user code. Change-Id: Id3575a54ff944bf0e89d452d13944fcaee270208 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -241,12 +241,12 @@ Id Id::versionedId(const QByteArray &prefix, int major, int minor)
|
||||
|
||||
QSet<Id> Id::fromStringList(const QStringList &list)
|
||||
{
|
||||
return QSet<Id>::fromList(Utils::transform(list, &Id::fromString));
|
||||
return Utils::transform<QSet<Id>>(list, &Id::fromString);
|
||||
}
|
||||
|
||||
QStringList Id::toStringList(const QSet<Id> &ids)
|
||||
{
|
||||
QList<Id> idList = ids.toList();
|
||||
QList<Id> idList = Utils::toList(ids);
|
||||
Utils::sort(idList);
|
||||
return Utils::transform(idList, &Id::toString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user