##// END OF EJS Templates
Uses Qt::SizeHintRole to set column width and height
Alexandre Leroux -
r258:97758c973a6d
parent child
Show More
@@ -21,6 +21,14 VariableInspectorWidget::VariableInspectorWidget(QWidget *parent)
21
21
22 ui->tableView->setModel(sortFilterModel);
22 ui->tableView->setModel(sortFilterModel);
23
23
24 // Fixes column sizes
25 auto model = ui->tableView->model();
26 const auto count = model->columnCount();
27 for (auto i = 0; i < count; ++i) {
28 ui->tableView->setColumnWidth(
29 i, model->headerData(i, Qt::Horizontal, Qt::SizeHintRole).toSize().width());
30 }
31
24 // Connection to show a menu when right clicking on the tree
32 // Connection to show a menu when right clicking on the tree
25 ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu);
33 ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu);
26 connect(ui->tableView, &QTableView::customContextMenuRequested, this,
34 connect(ui->tableView, &QTableView::customContextMenuRequested, this,
General Comments 0
You need to be logged in to leave comments. Login now