logic: Directory list box now restricts the user to select files, directories or both if required

* split QtDirectoryListBox and QtStringListBox
* renamed QtDirectoryListBox to QtPathListBox
* extracted QtListItemWidget class to own file
* renamed QtListItemWidget to QtListBoxItem
* added SelectionPolicyType to QtPathListBox to allow for specifying if selecting files, directories or both should be allowed.
This commit is contained in:
mlangkabel
2018-03-30 18:25:58 +02:00
parent af1657f7e5
commit 3ffe76d161
26 changed files with 884 additions and 619 deletions
+6 -5
View File
@@ -1,10 +1,10 @@
#ifndef QT_PATH_LIST_DIALOG_H
#define QT_PATH_LIST_DIALOG_H
#include "qt/element/QtPathListBox.h"
#include "qt/window/QtWindow.h"
class FilePath;
class QtDirectoryListBox;
class QtPathListDialog
: public QtWindow
@@ -12,7 +12,7 @@ class QtPathListDialog
Q_OBJECT
public:
QtPathListDialog(const QString& title, const QString& description, QWidget* parent = 0);
QtPathListDialog(const QString& title, const QString& description, QtPathListBox::SelectionPolicyType selectionPolicy, QWidget* parent = 0);
QSize sizeHint() const override;
@@ -24,11 +24,12 @@ protected:
void populateWindow(QWidget* widget) override;
void windowReady() override;
QString m_title;
QString m_description;
const QString m_title;
const QString m_description;
private:
QtDirectoryListBox* m_pathList;
const QtPathListBox::SelectionPolicyType m_selectionPolicy;
QtPathListBox* m_pathList;
};
#endif // QT_PATH_LIST_DIALOG_H