Documentation
¶
Index ¶
- func OpenDialog(ct ConfigurableStruct, parent *qt.QWidget, title string, onFinished func())
- type AddressPort
- type ConfigurableStruct
- type EnumList
- type ExistingDirectory
- type ExistingFile
- type Header
- type MultiLineString
- type OneOf
- type Password
- type Renderer
- type Resetter
- type SaveFunc
- type TabGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenDialog ¶
func OpenDialog(ct ConfigurableStruct, parent *qt.QWidget, title string, onFinished func())
OpenDialog opens the struct for editing in a new modal dialog in the current global event loop. The dialog only has an "OK" button, you can't cancel your modifications to the supplied struct, the struct saver is always called.
Types ¶
type AddressPort ¶
AddressPort allows entering a text address and a numeric port. The port is limited to the 0-65535 range.
func (AddressPort) Render ¶ added in v0.3.0
func (AddressPort) Render(area *qt.QFormLayout, rv *reflect.Value, tag reflect.StructTag, label string) SaveFunc
func (AddressPort) String ¶ added in v0.3.0
func (a AddressPort) String() string
type ConfigurableStruct ¶
type ConfigurableStruct interface{}
type EnumList ¶
type EnumList int
EnumList allows choosing from a dropdown. The integer value is the 0-based index of available options. Available options should be set in the `yenum` struct tag, separated by ";;".
type ExistingDirectory ¶
type ExistingDirectory string
ExistingDirectory allows browsing for an existing directory. The string value is the absolute path to the directory on disk.
func (ExistingDirectory) Render ¶ added in v0.3.0
func (ExistingDirectory) Render(area *qt.QFormLayout, rv *reflect.Value, tag reflect.StructTag, label string) SaveFunc
func (ExistingDirectory) String ¶ added in v0.4.0
func (e ExistingDirectory) String() string
type ExistingFile ¶
type ExistingFile string
ExistingFile allows browsing for an existing file. The string value is the absolute path to the file on disk. If the `yfilter` struct tag is present, this allows constraining the file types using Qt syntax.
func (*ExistingFile) Render ¶ added in v0.3.0
func (*ExistingFile) Render(area *qt.QFormLayout, rv *reflect.Value, tag reflect.StructTag, label string) SaveFunc
func (ExistingFile) String ¶ added in v0.4.0
func (f ExistingFile) String() string
type Header ¶ added in v0.2.0
type Header struct{}
Header shows a single-line header across the form. Use the `ylabel` tag to set the header's text.
type OneOf ¶ added in v0.3.0
type OneOf string
If a OneOf is the first member in a struct, the struct rendering will change to allow selecting one of the remaining struct members.
All the remaining struct members must be pointer types.
Each struct member's 'ylabel' tag is used as the dropdown selection's label. Each struct member's 'yicon' tag, if present, is used as the dropdown selection's icon. The icon can either be a theme icon, or (with `:/` prefix) a Qt embedded resource.
When saving, only the selected struct member will be populated; all other values will be set to nil.
type Renderer ¶ added in v0.3.0
type Renderer interface {
Render(area *qt.QFormLayout, rv *reflect.Value, tag reflect.StructTag, label string) SaveFunc
}
Renderer is a custom-rendered type that can be interacted with automatically by the autoconfig package.
type Resetter ¶ added in v0.3.0
type Resetter interface {
Reset()
}
Resetter is a type that can reset itself to default values. It's used if autoconfig needs to initialize a child struct.
type SaveFunc ¶
type SaveFunc func()
func MakeConfigArea ¶
func MakeConfigArea(ct ConfigurableStruct, area *qt.QFormLayout) SaveFunc
MakeConfigArea makes a config area by pushing elements into a QFormLayout. Use the returned function to force all changes from the UI to be saved to the struct.
type TabGroup ¶ added in v0.5.0
type TabGroup struct{}
If a TabGroup is the first member in a struct, the struct rendering will change to show all remaining fields as tabs.
All the remaining struct members must be non-pointer types.
Each struct member's 'ylabel' tag is used as the tab's label. Each struct member's 'yicon' tag, if present, is used as the tab's icon. The icon can either be a theme icon, or (with `:/` prefix) a Qt embedded resource.
Source Files
¶
- config.go
- dialog.go
- format.go
- style.go
- typeAddressPort.go
- typeBool.go
- typeByteSlice.go
- typeComplex.go
- typeEnumList.go
- typeExistingDirectory.go
- typeExistingFile.go
- typeFixed.go
- typeFloat.go
- typeHeader.go
- typeInt.go
- typeMap.go
- typeMultilineString.go
- typeOneOf.go
- typePassword.go
- typePointer.go
- typeSlice.go
- typeString.go
- typeStruct.go
- typeTabGroup.go
- typeTimeTime.go