14 #include <QSortFilterProxyModel>
22 setWindowTitle(tr(
"Edit monsters"));
24 QGridLayout*
layout =
new QGridLayout(
this);
26 QTableView *view =
new QTableView();
27 layout->addWidget(view, 0, 0, 1, 2);
29 QPushButton* save =
new QPushButton(tr(
"Save"),
this);
30 connect(save, SIGNAL(clicked()), resources, SLOT(saveArchetypes()));
31 layout->addWidget(save, 1, 0, 1, 1);
33 QPushButton *close =
new QPushButton(tr(
"Close"),
this);
34 connect(close, SIGNAL(clicked()),
this, SLOT(reject()));
35 layout->addWidget(close, 1, 1, 1, 1);
40 QSortFilterProxyModel* proxyModel =
new QSortFilterProxyModel();
41 proxyModel->setSourceModel(model);
42 view->setModel(proxyModel);
43 view->setEditTriggers(QAbstractItemView::DoubleClicked);
44 view->setSortingEnabled(
true);