sortersqmltypes.cpp
1 #include "sorter.h" 2 #include "rolesorter.h" 3 #include "stringsorter.h" 4 #include "filtersorter.h" 5 #include "expressionsorter.h" 6 #include "sortercontainer.h" 7 #include <QQmlEngine> 8 #include <QCoreApplication> 9 10 namespace qqsfpm { 11 12 void registerSorterTypes() { 13 qmlRegisterUncreatableType<Sorter>("SortFilterProxyModel", 0, 2, "Sorter", QStringLiteral("Sorter is an abstract class")); 14 qmlRegisterType<RoleSorter>("SortFilterProxyModel", 0, 2, "RoleSorter"); 15 qmlRegisterType<StringSorter>("SortFilterProxyModel", 0, 2, "StringSorter"); 16 qmlRegisterType<FilterSorter>("SortFilterProxyModel", 0, 2, "FilterSorter"); 17 qmlRegisterType<ExpressionSorter>("SortFilterProxyModel", 0, 2, "ExpressionSorter"); 18 qmlRegisterUncreatableType<SorterContainerAttached>("SortFilterProxyModel", 0, 2, "SorterContainer", QStringLiteral("SorterContainer can only be used as an attaching type")); 19 } 20 21 Q_COREAPP_STARTUP_FUNCTION(registerSorterTypes) 22 23 }