What class of Qt can replace the class CPtrList of MFC?
-
wrote on 7 May 2017, 06:26 last edited by
The question is as the title: What class of Qt can replace the class CPtrList of MFC?
-
The question is as the title: What class of Qt can replace the class CPtrList of MFC?
wrote on 7 May 2017, 15:58 last edited by@small_bird
I don't know what the CPtrList class normally does, but as i think it is a list which stores pointers?Have a look here.
-
wrote on 7 May 2017, 16:22 last edited by
Yes it seems to be a list of pointers, https://msdn.microsoft.com/en-us/library/0sbwsc4e.aspx. Beecksche gave a proper link. But in many cases you can also use the standard C++ STL containers if you want (http://en.cppreference.com/w/cpp/container, http://www.cplusplus.com/reference/stl/).
-
Yes it seems to be a list of pointers, https://msdn.microsoft.com/en-us/library/0sbwsc4e.aspx. Beecksche gave a proper link. But in many cases you can also use the standard C++ STL containers if you want (http://en.cppreference.com/w/cpp/container, http://www.cplusplus.com/reference/stl/).
-
@Eeli-K
When using the Qt Framework i would prefer the Qt containers:These container classes are designed to be lighter, safer, and easier to use than the STL containers
Lifetime Qt Championwrote on 7 May 2017, 18:08 last edited by mrjj 5 Jul 2017, 18:08@beecksche
a QList<Type *> would work the same it seems.
The access functions are very similar but of course named differently.
1/5