diff --git a/src/libs/vtools/undocommands/savetooloptions.cpp b/src/libs/vtools/undocommands/savetooloptions.cpp index fb8bd4de3..312b43008 100644 --- a/src/libs/vtools/undocommands/savetooloptions.cpp +++ b/src/libs/vtools/undocommands/savetooloptions.cpp @@ -93,12 +93,14 @@ void SaveToolOptions::redo() //--------------------------------------------------------------------------------------------------------------------- QVector SaveToolOptions::Missing(const QList &list1, const QList &list2) const { - QSet set1 = QSet::fromList(list1); - QSet set2 = QSet::fromList(list2); #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + auto set1 = QSet(list1.begin(), list1.end()); + auto set2 = QSet(list2.begin(), list2.end()); QSet substracted = set1.subtract(set2); return QVector(substracted.begin(), substracted.end()); #else + auto set1 = QSet::fromList(list1); + auto set2 = QSet::fromList(list2); return set1.subtract(set2).toList().toVector(); #endif } @@ -114,11 +116,13 @@ bool SaveToolOptions::mergeWith(const QUndoCommand *command) } else { - const QSet currentSet; - currentSet.fromList(newDependencies); - - const QSet candidateSet; - candidateSet.fromList(saveCommand->NewDependencies()); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + auto currentSet = QSet(newDependencies.begin(), newDependencies.end()); + auto candidateSet = QSet(saveCommand->NewDependencies().begin(), saveCommand->NewDependencies().end()); +#else + auto currentSet = QSet::fromList(newDependencies); + auto candidateSet = QSet::fromList(saveCommand->NewDependencies()); +#endif if (currentSet != candidateSet) {