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
11class QHBoxLayout;
12class QVBoxLayout;
13class QLineEdit;
14class QListView;
15class QLabel;
16class QSpacerItem;
17class QStringListModel;
18class QStackedWidget;
19class PageWidget;
20
21class PropertiesDialog : public QDialog
22{
23 Q_OBJECT
24public:
25 explicit PropertiesDialog(QWidget *parent = nullptr);
26
27 bool insertPropertyPanel(const QString &itemName, PageWidget *panel);
28 void showPropertyPanel(const QString &itemName, const QString &tabName);
29signals:
30
31public slots:
32 void slotLeftBarClicked(const QModelIndex &index);
33 void saveSingleConfig();
34 void saveAllConfig();
35 void slotFilterText(const QString &text);
36
37private:
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