summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qitemeditorfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews/qitemeditorfactory.cpp')
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index c044d37575..c535cf5f9e 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -55,6 +55,7 @@
#include <qapplication.h>
#include <qdebug.h>
+#include <vector>
#include <algorithm>
QT_BEGIN_NAMESPACE
@@ -191,9 +192,11 @@ QByteArray QItemEditorFactory::valuePropertyName(int userType) const
QItemEditorFactory::~QItemEditorFactory()
{
//we make sure we delete all the QItemEditorCreatorBase
- //this has to be done only once, hence the QSet
- QSet<QItemEditorCreatorBase*> set = creatorMap.values().toSet();
- qDeleteAll(set);
+ //this has to be done only once, hence the sort-unique idiom
+ std::vector<QItemEditorCreatorBase*> creators(creatorMap.cbegin(), creatorMap.cend());
+ std::sort(creators.begin(), creators.end());
+ const auto it = std::unique(creators.begin(), creators.end());
+ qDeleteAll(creators.begin(), it);
}
/*!