Hi,

i do not fully understand the concept of pointers. Maybe someone could help me to understand.

I have a printing function that is called several times. The data within the models that are shown in the centralWidgets tables are printed. Therefore I am doing a cast to get the proxymodels:

Qt Code:
  1. void MyApp::printDialog()
  2. {
  3. QSortFilterProxyModel *tmMain = qobject_cast<QSortFilterProxyModel *>(cw->mainTable()->model());
  4. SortFilterProxyModel *tmDetail = qobject_cast<SortFilterProxyModel *>(cw->detailTable()->model());
  5. ....
  6. }
To copy to clipboard, switch view to plain text mode 

I am processing the data and insert them into the printingModel. My question is: What happens to the pointers *tmMain and *tmDetail after they run out of scope? Are they deleted because they are local variables? Or do I need to set them to =0? Do I get a copy of the object from the cast or a pointer to the object ...? Sorry, many questions. Thx in advance.