diff options
Diffstat (limited to 'collectionwidget.cpp')
-rw-r--r-- | collectionwidget.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/collectionwidget.cpp b/collectionwidget.cpp new file mode 100644 index 0000000..a27041a --- /dev/null +++ b/collectionwidget.cpp @@ -0,0 +1,18 @@ +#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); + QHBoxLayout *mainLayout = new QHBoxLayout; + mainLayout->addWidget(mView); + setLayout(mainLayout); +} |