19 #include <QDialogButtonBox>
20 #include <QHBoxLayout>
21 #include <QHeaderView>
22 #include <QSortFilterProxyModel>
29 this->setWindowTitle(
"MITK Modules");
31 auto layout =
new QVBoxLayout();
32 this->setLayout(layout);
34 auto tableView =
new QTableView(
this);
36 auto sortProxyModel =
new QSortFilterProxyModel(tableView);
37 sortProxyModel->setSourceModel(tableModel);
38 sortProxyModel->setDynamicSortFilter(
true);
39 tableView->setModel(sortProxyModel);
41 tableView->verticalHeader()->hide();
42 tableView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
43 tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
44 tableView->setSelectionMode(QAbstractItemView::ExtendedSelection);
45 tableView->setTextElideMode(Qt::ElideMiddle);
46 tableView->setSortingEnabled(
true);
47 tableView->sortByColumn(0, Qt::AscendingOrder);
49 tableView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
50 tableView->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
51 tableView->horizontalHeader()->setStretchLastSection(
true);
52 tableView->horizontalHeader()->setCascadingSectionResizes(
true);
54 layout->addWidget(tableView);
56 auto btnBox =
new QDialogButtonBox(QDialogButtonBox::Close);
57 layout->addWidget(btnBox);
59 this->resize(800, 600);
61 connect(btnBox, SIGNAL(rejected()),
this, SLOT(reject()));
QmitkModulesDialog(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::CustomizeWindowHint|Qt::WindowCloseButtonHint)