//area->setWidgetResizable(true);
hBox
->setSizeConstraint
(QLayout::SetNoConstraint);
hBox
->setGeometry
(QRect(0,
0,
1000,
1000));
tableView1->setModel(model);
hBox->addWidget(tableView1);
tableView1->resize(1000, 1000);
tableView1->setGeometry(0, 0, 1000, 1000);
tableView2->setModel(model);
hBox->addWidget(tableView2);
window->show();
return app.exec();
QStandardItemModel *model=new QStandardItemModel();
model->setItem(0, 0, new QStandardItem("item 1"));
model->setItem(0, 1, new QStandardItem("item 2"));
model->setItem(0, 2, new QStandardItem("item 3"));
model->setItem(0, 3, new QStandardItem("item 3"));
model->setItem(0, 4, new QStandardItem("item 3"));
model->setItem(0, 5, new QStandardItem("item 3"));
QWidget *window = new QWidget;
window->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
QScrollArea * area = new QScrollArea(window);
//area->setWidgetResizable(true);
area->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
QHBoxLayout * hBox = new QHBoxLayout(area);
hBox->setSizeConstraint(QLayout::SetNoConstraint);
hBox->setGeometry(QRect(0, 0, 1000, 1000));
QTableView *tableView1 = new QTableView();
tableView1->setModel(model);
hBox->addWidget(tableView1);
tableView1->resize(1000, 1000);
tableView1->setGeometry(0, 0, 1000, 1000);
QTableView *tableView2 = new QTableView();
tableView2->setModel(model);
hBox->addWidget(tableView2);
window->show();
return app.exec();
To copy to clipboard, switch view to plain text mode
Bookmarks