About "Object's pointers & Memory"
I also take an advise from a Pro in C++ & memory management.
His solution is implement a Factory Pattern to Create/Delete Object's pointers
(also free memory when an instance had no pointer to it.)
(I think I'll give it a try)
void B::newData_ready(QString data); //you have to pass apropriate type, assuming QString since it is from QLineEdit
void A::on_newData_ready(QString data)
QTableWidgetItem *item = new QTableWidgetItem(data);
//here add item where u want
connect(B, SIGNAL(newData_ready(QString)), A, SLOT(on_newData_ready(QString)));
Just a scheme so it probably wont work like that but I hope you get the point.
The advatage of a QScopedPointer is that you don't have to care about the destruction of the object, right?
Yes. It's a thin wrapper around the raw pointer and will delete the held reference when it goes out of scope. The idea is to use the stack based QScopedPointer object to manage the heap-allocated object it's referencing.
Both inputs are highly appreciated. I understand better how, when and why should I choose pointers over refs. I'm still reading some stuff here and there on how to produce some good code.
Memory management has always been a doozy matter in C++ and i just can't get this Stroustrup quote out of my head : "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off. ".
Thanks again for replying so quickly, I will apply everything i've learned here on my work asap.