Qt6: Workaround for ListModel iterators

Change-Id: I622b42b8aea4f06b62e8739f7e8abb234ed7d3b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-07-22 13:50:25 +02:00
parent 5363256acd
commit efc39f971e
2 changed files with 4 additions and 6 deletions

View File

@@ -67,10 +67,8 @@ public:
void clear() { rootItem()->removeChildren(); }
using const_iterator = typename QVector<ChildType *>::const_iterator;
const_iterator begin() const { return const_iterator(rootItem()->begin()); }
const_iterator end() const { return const_iterator(rootItem()->end()); }
auto begin() const { return rootItem()->begin(); }
auto end() const { return rootItem()->end(); }
};
template <class ItemData>

View File

@@ -165,8 +165,8 @@ void InterpreterOptionsWidget::apply()
}
QList<Interpreter> interpreters;
for (const ListItem<Interpreter> *treeItem : m_model)
interpreters << treeItem->itemData;
for (const TreeItem *treeItem : m_model)
interpreters << static_cast<const ListItem<Interpreter> *>(treeItem)->itemData;
PythonSettings::setInterpreter(interpreters, m_defaultId);
}