-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiisStringListEdit.h
executable file
·90 lines (70 loc) · 2.19 KB
/
iisStringListEdit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* iisStringListEdit.h
*
* Created on: 08.07.2008
*
* Industrial Infosystems (c) 2008
* www.ii-system.com
*
* This component is freeware and could be used while building any applications.
* Removal/modification of this information not permitted.
*/
#ifndef IISSTRINGLISTEDIT_H_
#define IISSTRINGLISTEDIT_H_
#include <QtWidgets>
////////////////////////////////////////////////////////////////////////////////
enum StringListEditFlags {
SLF_Custom = 1,
SLF_Files = 2,
SLF_Dirs = 4
};
/**
* \class iisStringListEdit
* \brief This class is intended to visually edit a QStringList content.
*/
class iisStringListEdit : public QWidget
{
Q_OBJECT
public:
iisStringListEdit(QWidget *parent = 0, int flags = SLF_Custom);
virtual ~iisStringListEdit();
void setList(const QStringList &list);
QStringList list() const;
static QIcon IconPickDir, IconPickFile, IconAdd, IconDelete;
protected slots:
void add();
void addFile();
void addDir();
void del();
void onCurrentItemChanged(QListWidgetItem * current, QListWidgetItem * previous);
protected:
QAction *delAction;
QListWidgetItem* addItem(const QString &text);
bool eventFilter(QObject *obj, QEvent *event);
protected:
QListWidget *myListWidget;
};
////////////////////////////////////////////////////////////////////////////////
/**
* \class iisStringListEditDialog
* \brief This class provides a dialog window with iisStringListEdit component inside.
*/
class iisStringListEditDialog : public QDialog
{
public:
iisStringListEditDialog(const QString &title = QString(),
int flags = SLF_Custom,
QWidget *parent = 0,
Qt::WindowFlags f = 0);
virtual ~iisStringListEditDialog();
void setList(const QStringList &list);
QStringList list() const;
static bool getList(QStringList &list,
const QString &title = QString(),
int flags = SLF_Custom,
QWidget *parent = 0);
protected:
iisStringListEdit *myListEdit;
};
////////////////////////////////////////////////////////////////////////////////
#endif /* IISSTRINGLISTEDIT_H_ */