Judging from the error message, yes.Originally Posted by zlatko
Judging from the error message, yes.Originally Posted by zlatko
Understand...So i can't get in other way position(index) of curent iterators item ?
a life without programming is like an empty bottle![]()
This should work:Originally Posted by zlatko
Qt Code:
for( int i = 0, GroupList::const_iterator itGr = gl_GroupList.constBegin(); itGr != gl_GroupList.constEnd(); ++i, ++itGr) { int m_nCurrKey = i; //... }To copy to clipboard, switch view to plain text mode
No it was my first solution...Actually like this becouse yours cant be compiled
Qt Code:
int i; for( i = 0, GroupList::const_iterator itGr = gl_GroupList.constBegin(); itGr != gl_GroupList.constEnd(); ++i, ++itGr) { int m_nCurrKey = i;To copy to clipboard, switch view to plain text mode
But the i think must be more elegant way to solve it...Now i see that its imposible![]()
a life without programming is like an empty bottle![]()
Either you use iterators or access your data by index. Usually there is no need to do both.Originally Posted by zlatko
You can always do this:Qt Code:
const int size = gl_GroupList.size(); for( int i = 0; i < size; ++i ) { int m_nCurrKey = i; //... // gl_GroupList[i] //... };To copy to clipboard, switch view to plain text mode
Yes it can be more flexibility solution
thanks![]()
a life without programming is like an empty bottle![]()
Bookmarks