diff options
Diffstat (limited to 'logic/lists/InstanceList.cpp')
-rw-r--r-- | logic/lists/InstanceList.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp index 7081dc6f..200b02df 100644 --- a/logic/lists/InstanceList.cpp +++ b/logic/lists/InstanceList.cpp @@ -362,7 +362,7 @@ int InstanceList::add(InstancePtr t) return count() - 1; } -InstancePtr InstanceList::getInstanceById(QString instId) +InstancePtr InstanceList::getInstanceById(QString instId) const { QListIterator<InstancePtr> iter(m_instances); InstancePtr inst; @@ -378,7 +378,12 @@ InstancePtr InstanceList::getInstanceById(QString instId) return iter.peekPrevious(); } -int InstanceList::getInstIndex(BaseInstance *inst) +QModelIndex InstanceList::getInstanceIndexById(const QString &id) const +{ + return index(getInstIndex(getInstanceById(id).get())); +} + +int InstanceList::getInstIndex(BaseInstance *inst) const { for (int i = 0; i < m_instances.count(); i++) { |