ok with 2) i've solve problem with >> operator...but anything else is working xD i'm sure is a reference/pointer stuff. i mean, i'm adding to my QList<Service> a reference Service service in a method called "addItems". Will it be this reference deleted once the addItems is over even if it's now linked in my list?! so should i use Service * service = new Service() and then add with list->append(*service) ?!
MyClass item; //creating a new item item.stuff = 42; MyClass item2 = item; //behind the scenes, item2 copies item item.stuff = 8; //this line doesn't change item2
item2 = item;
item2.operator=(item);
MyClass::operator=(const MyClass& other) { ... }
MyClass item2 = item;
MyClass item2(item);
MyClass::MyClass(const MyClass& other) { ... }