|
QtCanpool 3.3.0
|
One setting, described well enough to be edited. 更多...
#include <qxapp/qxproperty.h>
Public 类型 | |
| enum | Type { Bool , Int , Double , String , Text , Enum , Color , Font , Path } |
| The kind of value the property takes, and therefore the control it is edited with. 更多... | |
| enum | PathMode { ExistingFile , AnyFile , Directory } |
| What the browse button of a Path property is looking for. 更多... | |
Public 属性 | |
| QString | key |
| Stable name the value is stored under. | |
| QString | label |
| Text shown next to the control; the key is used when it is empty. | |
| Type | type = String |
| QVariant | value |
| The current value. | |
| QVariant | defaultValue |
| The value the property has when nobody has set it. | |
| QStringList | choices |
| The choices an Enum offers; unused by every other type. | |
| QString | tooltip |
| Text shown when the pointer rests on the control. | |
| PathMode | pathMode = ExistingFile |
| What the browse button picks, for Path. | |
| bool | readOnly = false |
| Whether the control is shown disabled. | |
One setting, described well enough to be edited.
A property is a value with a name, not a row of widgets: it says what the setting is called, what kind of value it takes, what it is worth now and what it is worth when nobody has said anything. QxPropertyEditor turns a list of them into a form, and a settings dialog turns them into keys of a configuration file.
The key is the part that has to be stable: it is what the value is stored under, so renaming it abandons every value a user ever chose. The label, the tooltip and the choices are presentation and may be translated freely.
The struct is plain data on purpose - there is nothing to inherit from and no state to hide, so a caller can build one with aggregate initialisation or keep a static table of them.
在文件 qxproperty.h 第 44 行定义.
What the browse button of a Path property is looking for.
| 枚举值 | |
|---|---|
| ExistingFile | a file that has to be there |
| AnyFile | a file, whether or not it exists yet |
| Directory | a folder |
在文件 qxproperty.h 第 62 行定义.
The kind of value the property takes, and therefore the control it is edited with.
在文件 qxproperty.h 第 48 行定义.
| QStringList QxApp::QxProperty::choices |
The choices an Enum offers; unused by every other type.
在文件 qxproperty.h 第 79 行定义.
| QVariant QxApp::QxProperty::defaultValue |
The value the property has when nobody has set it.
在文件 qxproperty.h 第 77 行定义.
| QString QxApp::QxProperty::key |
| QString QxApp::QxProperty::label |
Text shown next to the control; the key is used when it is empty.
在文件 qxproperty.h 第 72 行定义.
| PathMode QxApp::QxProperty::pathMode = ExistingFile |
What the browse button picks, for Path.
在文件 qxproperty.h 第 83 行定义.
| bool QxApp::QxProperty::readOnly = false |
Whether the control is shown disabled.
在文件 qxproperty.h 第 85 行定义.
| QString QxApp::QxProperty::tooltip |
Text shown when the pointer rests on the control.
在文件 qxproperty.h 第 81 行定义.
在文件 qxproperty.h 第 73 行定义.
| QVariant QxApp::QxProperty::value |
The current value.
在文件 qxproperty.h 第 75 行定义.