blob: d66570605c257f00231c0212e9d5d4ea3d068065 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include <QTreeView>
#include <QStandardItem>
#include <QSortFilterProxyModel>
#include <QHBoxLayout>
#include "collectionwidget.h"
CollectionWidget::CollectionWidget(QWidget *parent) : QWidget(parent){
mView = new QTreeView;
mModel = new QStandardItemModel(this);
mProxy = new QSortFilterProxyModel(this);
mProxy->setSourceModel(mModel);
mView->setModel(mProxy);
mView->setSortingEnabled(true);
mView->setAlternatingRowColors(true);
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addWidget(mView);
setLayout(mainLayout);
}
|