From f459b30a4ab8ac4bc5d6646795d2e391f70851d3 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 4 Jan 2018 09:04:48 +0100 Subject: Rename dirselectionwidget > itemselectionwidget It's much more general purpose than I thought. I'm gonna reuse the code for MIME-type filters later on. --- itemselectionwidget.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 itemselectionwidget.h (limited to 'itemselectionwidget.h') diff --git a/itemselectionwidget.h b/itemselectionwidget.h new file mode 100644 index 0000000..0b8b48b --- /dev/null +++ b/itemselectionwidget.h @@ -0,0 +1,29 @@ +#ifndef DIRSELECTIONWIDGET_H +#define DIRSELECTIONWIDGET_H + +#include + +class QStandardItemModel; +class QListView; +class QLineEdit; + +class ItemSelectionWidget : public QWidget +{ + Q_OBJECT + public: + explicit ItemSelectionWidget(QWidget *parent = nullptr); + const QStringList directories() const; + void setDirectories(const QStringList &dirs); + + public slots: + void browseDir(); + void addDir(); + void removeDir(); + + private: + QStandardItemModel *mModel; + QListView *mView; + QLineEdit *mDir; +}; + +#endif // DIRSELECTIONWIDGET_H -- cgit v1.2.3-70-g09d2