diff --git a/libinstance/include/instancelist.h b/libinstance/include/instancelist.h index f6be815c..d5b8c196 100644 --- a/libinstance/include/instancelist.h +++ b/libinstance/include/instancelist.h @@ -26,7 +26,7 @@ class Instance; -class LIBMMCINST_EXPORT InstanceList : public QObject, public SigList> +class LIBMMCINST_EXPORT InstanceList : public QObject, public SigList< QSharedPointer > { Q_OBJECT public: diff --git a/libinstance/src/instanceloader.cpp b/libinstance/src/instanceloader.cpp index 620562b6..9d98230f 100644 --- a/libinstance/src/instanceloader.cpp +++ b/libinstance/src/instanceloader.cpp @@ -100,7 +100,7 @@ InstTypeList InstanceLoader::typeList() { InstTypeList typeList; - for (auto iter = m_typeMap.begin(); iter != m_typeMap.end(); iter++) + for (QMap::iterator iter = m_typeMap.begin(); iter != m_typeMap.end(); iter++) { typeList.append(*iter); } diff --git a/libutil/include/siglist.h b/libutil/include/siglist.h index b6432b6e..347cf752 100644 --- a/libutil/include/siglist.h +++ b/libutil/include/siglist.h @@ -26,6 +26,8 @@ template class SigList : public QList { +private: + typedef typename QList::iterator iterator; public: explicit SigList() : QList() {} diff --git a/libutil/include/siglist_impl.h b/libutil/include/siglist_impl.h index 16ddd9b0..cb37ea4b 100644 --- a/libutil/include/siglist_impl.h +++ b/libutil/include/siglist_impl.h @@ -19,7 +19,7 @@ template void SigList::append(const T &value) { QList::append(value); - onItemAdded(value, length() - 1); + onItemAdded(value, QList::length() - 1); } template @@ -32,7 +32,7 @@ void SigList::prepend(const T &value) template void SigList::append(const QList &other) { - int index = length(); + int index = QList::length(); QList::append(other); onItemsAdded(other, index); } @@ -45,7 +45,7 @@ void SigList::clear() } template -void SigList::erase(QList::iterator pos) +void SigList::erase(SigList::iterator pos) { T value = *pos; int index = indexOf(*pos); @@ -54,12 +54,12 @@ void SigList::erase(QList::iterator pos) } template -void SigList::erase(QList::iterator first, QList::iterator last) +void SigList::erase(SigList::iterator first, SigList::iterator last) { QList removedValues; int firstIndex = indexOf(*first); - for (QList::iterator iter = first; iter < last; iter++) + for (SigList::iterator iter = first; iter < last; iter++) { removedValues << *iter; QList::erase(iter); @@ -76,7 +76,7 @@ void SigList::insert(int i, const T &t) } template -void SigList::insert(QList::iterator before, const T &t) +void SigList::insert(SigList::iterator before, const T &t) { QList::insert(before, t); onItemAdded(t, indexOf(t)); @@ -85,7 +85,7 @@ void SigList::insert(QList::iterator before, const T &t) template void SigList::move(int from, int to) { - const T &item = at(from); + const T &item = QList::at(from); QList::move(from, to); onItemMoved(item, from, to); } @@ -120,8 +120,8 @@ void SigList::swap(QList &other) template void SigList::swap(int i, int j) { - const T &item1 = at(i); - const T &item2 = at(j); + const T &item1 = QList::at(i); + const T &item2 = QList::at(j); QList::swap(i, j); onItemMoved(item1, i, j); onItemMoved(item2, j, i); @@ -144,7 +144,7 @@ T SigList::takeFirst() template T SigList::takeLast() { - return takeAt(length() - 1); + return takeAt(QList::length() - 1); } template