1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef PROPERTIESDIALOG_H |
6 | #define PROPERTIESDIALOG_H |
7 | |
8 | #include <QtWidgets/QDialog> |
9 | #include <QMap> |
10 | |
11 | class QHBoxLayout; |
12 | class QVBoxLayout; |
13 | class QLineEdit; |
14 | class QListView; |
15 | class QLabel; |
16 | class QSpacerItem; |
17 | class QStringListModel; |
18 | class QStackedWidget; |
19 | class PageWidget; |
20 | |
21 | class PropertiesDialog : public QDialog |
22 | { |
23 | Q_OBJECT |
24 | public: |
25 | explicit PropertiesDialog(QWidget *parent = nullptr); |
26 | |
27 | bool insertPropertyPanel(const QString &itemName, PageWidget *panel); |
28 | void showPropertyPanel(const QString &itemName, const QString &tabName); |
29 | signals: |
30 | |
31 | public slots: |
32 | void slotLeftBarClicked(const QModelIndex &index); |
33 | void saveSingleConfig(); |
34 | void saveAllConfig(); |
35 | void slotFilterText(const QString &text); |
36 | |
37 | private: |
38 | void setupUi(QDialog *Dialog); |
39 | void readConfig(); |
40 | void savePropertiesToFile(); |
41 | void readPropertiesToFile(); |
42 | |
43 | QLineEdit *filterEdit = nullptr; |
44 | QListView *leftSideBar = nullptr; |
45 | QLabel *headTitle = nullptr; |
46 | |
47 | QMap<QString, PageWidget *> widgts; |
48 | QStringListModel *leftBarModel = nullptr; |
49 | QStackedWidget *stackWidget = nullptr; |
50 | |
51 | QStringList leftBarValues; |
52 | }; |
53 | |
54 | #endif // PROPERTIESDIALOG_H |
55 |