QtCanpool 3.3.0
载入中...
搜索中...
未找到
qxpropertyeditor_p.h
浏览该文件的文档.
1
5#pragma once
6
7#include "qxapp_global.h"
8#include "qxproperty.h"
9#include "qxpropertyeditor.h"
10
11#include <QtCore/QHash>
12#include <QtCore/QList>
13#include <QtCore/QVariant>
14
15QT_BEGIN_NAMESPACE
16class QFormLayout;
17class QVBoxLayout;
18QT_END_NAMESPACE
19
21
33{
35public:
37
38 struct Row {
40 QWidget *field = Q_NULLPTR;
41 QWidget *input = Q_NULLPTR;
42 };
43
44 void init();
45 int indexOf(const QString &key) const;
47 void insertRow(QFormLayout *form, const QxProperty &property);
49 QWidget *createField(const QxProperty &property, QWidget **input);
51 void connectField(int index);
52
53 QVariant readField(const Row &row) const;
54 void writeField(const Row &row, const QVariant &value);
56 void setRowValue(int index, const QVariant &value);
57 void updateModified();
58public:
59 QVBoxLayout *m_layout = Q_NULLPTR;
61 QFormLayout *m_form = Q_NULLPTR;
62 QList<Row> m_rows;
63 QHash<QString, QVariant> m_initial;
64 bool m_modified = false;
66 bool m_updating = false;
67};
68
The state behind QxPropertyEditor: one row per property, the baseline the values are compared against...
QHash< QString, QVariant > m_initial
A form built from a list of QxProperty descriptors.
#define QX_APP_END_NAMESPACE
#define QX_DECLARE_PUBLIC(Class)
#define Q_NULLPTR
Copyleft (C) 2025 maminjie canpool@163.com SPDX-License-Identifier: MulanPSL-2.0
#define QX_APP_BEGIN_NAMESPACE
One setting, described well enough to be edited.
Definition qxproperty.h:44