32 #include <QModelIndexList>
36 qRegisterMetaType<ScenarioItem*>();
37 qRegisterMetaType<ApplicationDatabaseItem*>();
38 qRegisterMetaType<OpenScenarioItem*>();
39 qRegisterMetaType<SettingsItem*>();
51 QModelIndex source_index = mapToSource(proxy_index);
52 return sourceModel()->data(source_index, role);
55 return QVariant::fromValue(
reinterpret_cast<ScenarioItem*
>(proxy_index.internalPointer()));
59 return QVariant::fromValue(
reinterpret_cast<OpenScenarioItem*
>(proxy_index.internalPointer()));
61 return QVariant::fromValue(
reinterpret_cast<SettingsItem*
>(proxy_index.internalPointer()));
70 QModelIndexList childrenColumn1;
72 childrenColumn1 << sourceModel()->index(sourceRow, 0, sourceParent);
75 for (
int i = 0; i < childrenColumn1.size(); ++i)
77 for (
int j = 0; j < sourceModel()->rowCount(childrenColumn1[i]); ++j)
79 childrenColumn1 << childrenColumn1[i].child(j, 0);
84 for (
int i = 0; i < childrenColumn1.size(); ++i)
86 if (sourceModel()->data(childrenColumn1[i]).toString().contains(filterRegExp()))
93 if (sourceModel()->columnCount() > 1)
95 QModelIndexList childrenColumn2;
97 childrenColumn2 << sourceModel()->index(sourceRow, 1, sourceParent);
100 for (
int i = 0; i < childrenColumn2.size(); ++i)
102 for (
int j = 0; j < sourceModel()->rowCount(childrenColumn2[i]); ++j)
104 childrenColumn2 << childrenColumn2[i].child(j, 1);
108 for (
int i = 0; i < childrenColumn2.size(); ++i)
110 if (sourceModel()->data(childrenColumn2[i]).toString().contains(filterRegExp()))