model->setHeaderData(0,Qt::Horizontal, tr("Surname"));
model->setHeaderData(1,Qt::Horizontal, tr("first name"));
model->setHeaderData(2,Qt::Horizontal, tr("pers. number"));
table->setModel(model);
table->setSelectionModel(selectionModel);
table
->setWindowTitle
(QObject::tr("Seznam zaku"));
table->setColumnWidth(0,75);
table->setColumnWidth(1,75);
table->setColumnWidth(2,70);
table->show();
model = new QStandardItemModel(count_peopl, 3, this);
model->setHeaderData(0,Qt::Horizontal, tr("Surname"));
model->setHeaderData(1,Qt::Horizontal, tr("first name"));
model->setHeaderData(2,Qt::Horizontal, tr("pers. number"));
QTableView *table = new QTableView;
table->setModel(model);
QItemSelectionModel *selectionModel = new QItemSelectionModel(model);
table->setSelectionModel(selectionModel);
table->setWindowTitle(QObject::tr("Seznam zaku"));
table->setColumnWidth(0,75);
table->setColumnWidth(1,75);
table->setColumnWidth(2,70);
table->show();
To copy to clipboard, switch view to plain text mode
Bookmarks