Thanks for you anwser.
I tried what you said, but it's still not working.
Does shadowing mean, that a global variable is hidden because a local variable is used instead?
What exactly happens here?
delete tableView;
/*QTableView * */ tableView = dmgr->customerTableView();
delete tableView;
/*QTableView * */ tableView = dmgr->customerTableView();
To copy to clipboard, switch view to plain text mode
As far as I unterstand, delete tableView does remove the QTableView object created in the QtDesigner-file ui_addressbook.h :
class Ui_AddressBook
{
public:
..
}
class Ui_AddressBook
{
public:
QTableView *tableView;
..
}
To copy to clipboard, switch view to plain text mode
Then my prepared QTableView returned by dmgr->customerTableView(); is assigned - but assigned to what? There is no other variable named tableView existing, I guess. Do I have to define an additional one with the same name in
AddressBook.h ?
Right now my code is
delete tableView;
Q_CHECK_PTR(tableView);
Q_CHECK_PTR(dmgr->customerTableView());
tableView = dmgr->customerTableView();
delete tableView;
Q_CHECK_PTR(tableView);
Q_CHECK_PTR(dmgr->customerTableView());
tableView = dmgr->customerTableView();
To copy to clipboard, switch view to plain text mode
Why does die application not quit on "Q_CHECK_PTR(tableView)" after "delete tableView" ?
Bookmarks