zl2k
19th September 2008, 04:44
hi, there
suppose I define
QList<MyStuff* > list;
in the header file. And I need to initialize an empty list in the initialization list of MyClass. How can I do that?
MyClass::MyClass() : list(0) {...} // won't compile
MyClass::MyClass() : list() {...} // not initialized
MyClass::MyClass() : list() {QList()} // not initialized
//what's the correct way to do that? It's fine if I have to use QList<MyStuff* > * list.
Thanks for help. I'm waiting online.
zl
suppose I define
QList<MyStuff* > list;
in the header file. And I need to initialize an empty list in the initialization list of MyClass. How can I do that?
MyClass::MyClass() : list(0) {...} // won't compile
MyClass::MyClass() : list() {...} // not initialized
MyClass::MyClass() : list() {QList()} // not initialized
//what's the correct way to do that? It's fine if I have to use QList<MyStuff* > * list.
Thanks for help. I'm waiting online.
zl