Hi
i dynamicly create a QMap and put it on QList
QMap<QPoint, int> myMap;
for(int i=0; i<5; i++)
{
for(int j=0; j<5; j++)
{
myMap.
insert(QPoint(j, i
),
0);
}
}
this->MapList.insert(0, myMap);
QMap<QPoint, int> myMap;
for(int i=0; i<5; i++)
{
for(int j=0; j<5; j++)
{
myMap.insert(QPoint(j, i), 0);
}
}
this->MapList.insert(0, myMap);
To copy to clipboard, switch view to plain text mode
and i can get the value but i can`t set it :C
1) this
->MapList.
at(0)[QPoint(x,y
)] = 1;
2) this
->MapList.
at(0).
insert(QPoint(x,y
),
1);
1) this->MapList.at(0)[QPoint(x,y)] = 1;
2) this->MapList.at(0).insert(QPoint(x,y), 1);
To copy to clipboard, switch view to plain text mode
1) lvalue required as left operand of assignment
2)passing 'const QMap<QPoint, int>' as 'this' argument of 'QMap<Key, T>::iterator QMap<Key, T>::insert(const Key&, const T&) [with Key = QPoint; T = int]' discards qualifiers [-fpermissive]
why it dont work ?
Bookmarks