QtCanpool 3.3.0
载入中...
搜索中...
未找到
qxsettingsdialog.h
浏览该文件的文档.
1
5#ifndef QXSETTINGSDIALOG_H
6#define QXSETTINGSDIALOG_H
7
8#include "qxapp_global.h"
9#include "qxproperty.h"
10
11#include "qxcore/qxsettings.h"
12
13#include <QtCore/QList>
14#include <QtCore/QString>
15#include <QtCore/QStringList>
16#include <QtGui/QIcon>
17#include <QtWidgets/QDialog>
18
19QT_BEGIN_NAMESPACE
20class QDialogButtonBox;
21class QListWidget;
22class QShowEvent;
23class QStackedWidget;
24QT_END_NAMESPACE
25
27
28class QxPropertyEditor;
29class QxSettingsDialogPrivate;
30
63class QX_APP_EXPORT QxSettingsDialog : public QDialog
64{
65 Q_OBJECT
66public:
67 explicit QxSettingsDialog(QX_CORE_PREPEND_NAMESPACE(QxSettings) * settings, QWidget *parent = Q_NULLPTR);
68 ~QxSettingsDialog() override;
69
70 QX_CORE_PREPEND_NAMESPACE(QxSettings) * settings() const;
71
77 void addPage(const QString &id, const QIcon &icon, const QString &title, const QList<QxProperty> &properties);
83 void addGroup(const QString &pageId, const QString &title, const QList<QxProperty> &properties);
84
85 QStringList pageIds() const;
87 QxPropertyEditor *editor(const QString &pageId) const;
88 QString currentPageId() const;
89
91 bool isModified() const;
92
93public Q_SLOTS:
95 void reload();
97 void reset();
99 void apply();
100 void setCurrentPage(const QString &id);
102 void accept() override;
104 void reject() override;
105
106Q_SIGNALS:
108 void applied();
109 void currentPageChanged(const QString &id);
110protected:
111 void showEvent(QShowEvent *event) override;
112private:
113 Q_DISABLE_COPY(QxSettingsDialog)
115};
116
118
119#endif // QXSETTINGSDIALOG_H
A form built from a list of QxProperty descriptors.
A settings dialog: a list of pages on the left, a key/value form on the right and the three things a ...
void currentPageChanged(const QString &id)
void applied()
The values have been written and synced.
Thin wrapper around QSettings that keeps call sites free of the usual boilerplate: typed accessors wi...
Definition qxsettings.h:32
#define QX_APP_END_NAMESPACE
#define QX_APP_EXPORT
#define QX_DECLARE_PRIVATE(Class)
#define Q_NULLPTR
Copyleft (C) 2025 maminjie canpool@163.com SPDX-License-Identifier: MulanPSL-2.0
#define QX_APP_BEGIN_NAMESPACE
#define QX_CORE_PREPEND_NAMESPACE(name)