homerun4711
2nd January 2011, 19:05
Hello!
Just another problem... :)
I have an AddressBook-class using a QtDesigner file.
But I can't get the QTableView to work correctly.
class Ui_AddressBook
{
public:
QTableView *tableView;
...
void setupUi(QDialog *AddressBook)
{
...
tableView = new QTableView(AddressBook);
tableView->setObjectName(QString::fromUtf8("tableView"));
tableView->setGeometry(QRect(10, 10, 701, 191));
....
}
AddressBook (inherits above class)
AddressBook::AddressBook(DataManager* dmgr, QWidget *parent): QDialog(parent)
{
setupUi(this); //here the "old" QTableView is set, see above
//customerTableView() belongs to my brandnew DataManager :)
//it returns a QTableView with its model already set
//I would like to display another QTableView here now:
tableView = dmgr->customerTableView();
//result is, that nothing is displayed in the box.
//if I add
tableView.show(); //another small window opens, showing the correct data.
}
What is the correct way to overwrite the "old" model?
delete tableView;
and set a new one?
Kind regards,
HomeR
Just another problem... :)
I have an AddressBook-class using a QtDesigner file.
But I can't get the QTableView to work correctly.
class Ui_AddressBook
{
public:
QTableView *tableView;
...
void setupUi(QDialog *AddressBook)
{
...
tableView = new QTableView(AddressBook);
tableView->setObjectName(QString::fromUtf8("tableView"));
tableView->setGeometry(QRect(10, 10, 701, 191));
....
}
AddressBook (inherits above class)
AddressBook::AddressBook(DataManager* dmgr, QWidget *parent): QDialog(parent)
{
setupUi(this); //here the "old" QTableView is set, see above
//customerTableView() belongs to my brandnew DataManager :)
//it returns a QTableView with its model already set
//I would like to display another QTableView here now:
tableView = dmgr->customerTableView();
//result is, that nothing is displayed in the box.
//if I add
tableView.show(); //another small window opens, showing the correct data.
}
What is the correct way to overwrite the "old" model?
delete tableView;
and set a new one?
Kind regards,
HomeR