Fixed some issues with GCC.

This commit is contained in:
Andrew Okin 2013-02-21 12:10:10 -06:00
parent 96e4f73a94
commit e9ef332ec4
4 changed files with 14 additions and 12 deletions

View File

@ -26,7 +26,7 @@
class Instance;
class LIBMMCINST_EXPORT InstanceList : public QObject, public SigList<QSharedPointer<Instance>>
class LIBMMCINST_EXPORT InstanceList : public QObject, public SigList< QSharedPointer<Instance> >
{
Q_OBJECT
public:

View File

@ -100,7 +100,7 @@ InstTypeList InstanceLoader::typeList()
{
InstTypeList typeList;
for (auto iter = m_typeMap.begin(); iter != m_typeMap.end(); iter++)
for (QMap<QString, InstanceTypeInterface *>::iterator iter = m_typeMap.begin(); iter != m_typeMap.end(); iter++)
{
typeList.append(*iter);
}

View File

@ -26,6 +26,8 @@
template <typename T>
class SigList : public QList<T>
{
private:
typedef typename QList<T>::iterator iterator;
public:
explicit SigList() : QList<T>() {}

View File

@ -19,7 +19,7 @@ template <typename T>
void SigList<T>::append(const T &value)
{
QList<T>::append(value);
onItemAdded(value, length() - 1);
onItemAdded(value, QList<T>::length() - 1);
}
template <typename T>
@ -32,7 +32,7 @@ void SigList<T>::prepend(const T &value)
template <typename T>
void SigList<T>::append(const QList<T> &other)
{
int index = length();
int index = QList<T>::length();
QList<T>::append(other);
onItemsAdded(other, index);
}
@ -45,7 +45,7 @@ void SigList<T>::clear()
}
template <typename T>
void SigList<T>::erase(QList<T>::iterator pos)
void SigList<T>::erase(SigList<T>::iterator pos)
{
T value = *pos;
int index = indexOf(*pos);
@ -54,12 +54,12 @@ void SigList<T>::erase(QList<T>::iterator pos)
}
template <typename T>
void SigList<T>::erase(QList<T>::iterator first, QList<T>::iterator last)
void SigList<T>::erase(SigList<T>::iterator first, SigList<T>::iterator last)
{
QList<T> removedValues;
int firstIndex = indexOf(*first);
for (QList<T>::iterator iter = first; iter < last; iter++)
for (SigList<T>::iterator iter = first; iter < last; iter++)
{
removedValues << *iter;
QList<T>::erase(iter);
@ -76,7 +76,7 @@ void SigList<T>::insert(int i, const T &t)
}
template <typename T>
void SigList<T>::insert(QList<T>::iterator before, const T &t)
void SigList<T>::insert(SigList<T>::iterator before, const T &t)
{
QList<T>::insert(before, t);
onItemAdded(t, indexOf(t));
@ -85,7 +85,7 @@ void SigList<T>::insert(QList<T>::iterator before, const T &t)
template <typename T>
void SigList<T>::move(int from, int to)
{
const T &item = at(from);
const T &item = QList<T>::at(from);
QList<T>::move(from, to);
onItemMoved(item, from, to);
}
@ -120,8 +120,8 @@ void SigList<T>::swap(QList<T> &other)
template <typename T>
void SigList<T>::swap(int i, int j)
{
const T &item1 = at(i);
const T &item2 = at(j);
const T &item1 = QList<T>::at(i);
const T &item2 = QList<T>::at(j);
QList<T>::swap(i, j);
onItemMoved(item1, i, j);
onItemMoved(item2, j, i);
@ -144,7 +144,7 @@ T SigList<T>::takeFirst()
template <typename T>
T SigList<T>::takeLast()
{
return takeAt(length() - 1);
return takeAt(QList<T>::length() - 1);
}
template <typename T>