From 3c648fed56a6c7a9f40353d95f4eff5baaecaf76 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 4 Jan 2018 08:04:10 +0100 Subject: Implement DirSelectionWidget This Widget lets you select a list of directories. It's basically about code reuse. We're gonna need this later when implementing the favorite directories feature. --- dirselectionwidget.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dirselectionwidget.h (limited to 'dirselectionwidget.h') diff --git a/dirselectionwidget.h b/dirselectionwidget.h new file mode 100644 index 0000000..7d43326 --- /dev/null +++ b/dirselectionwidget.h @@ -0,0 +1,29 @@ +#ifndef DIRSELECTIONWIDGET_H +#define DIRSELECTIONWIDGET_H + +#include + +class QStandardItemModel; +class QListView; +class QLineEdit; + +class DirSelectionWidget : public QWidget +{ + Q_OBJECT + public: + explicit DirSelectionWidget(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