15 #include <QDialogButtonBox> 16 #include <QHBoxLayout> 17 #include <QHeaderView> 18 #include <QSortFilterProxyModel> 25 this->setWindowTitle(
"MITK Modules");
27 auto layout =
new QVBoxLayout();
28 this->setLayout(layout);
30 auto tableView =
new QTableView(
this);
32 auto sortProxyModel =
new QSortFilterProxyModel(tableView);
33 sortProxyModel->setSourceModel(tableModel);
34 sortProxyModel->setDynamicSortFilter(
true);
35 tableView->setModel(sortProxyModel);
37 tableView->verticalHeader()->hide();
38 tableView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
39 tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
40 tableView->setSelectionMode(QAbstractItemView::ExtendedSelection);
41 tableView->setTextElideMode(Qt::ElideMiddle);
42 tableView->setSortingEnabled(
true);
43 tableView->sortByColumn(0, Qt::AscendingOrder);
45 tableView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
46 tableView->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
47 tableView->horizontalHeader()->setStretchLastSection(
true);
48 tableView->horizontalHeader()->setCascadingSectionResizes(
true);
50 layout->addWidget(tableView);
52 auto btnBox =
new QDialogButtonBox(QDialogButtonBox::Close);
53 layout->addWidget(btnBox);
55 this->resize(800, 600);
57 connect(btnBox, SIGNAL(rejected()),
this, SLOT(reject()));
QmitkModulesDialog(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::CustomizeWindowHint|Qt::WindowCloseButtonHint)