EV
Size: a a a
EV
EV
EV
EV
ДП
EV
EV
EV
EV
ДП
ДП
EV
V
VK
m
AS
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import Qt.labs.qmlmodels 1.0
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
QtObject {
id: object
property string name
property int age
}
ListModel {
id: model
ListElement {
objectType: "string"
objectProperty: "name"
}
ListElement {
objectType: "number"
objectProperty: "age"
}
}
DelegateChooser {
id: chooser
role: "objectType"
DelegateChoice {
roleValue: "string"
delegate: TextField {
placeholderText: "Введите строку"
text: object[objectProperty]
onTextChanged: {
object[objectProperty] = text
}
}
}
DelegateChoice {
roleValue: "number"
delegate: TextField {
placeholderText: "Введите число"
text: object[objectProperty]
onTextChanged: {
object[objectProperty] = parseInt(text)
}
}
}
}
ColumnLayout {
anchors.fill: parent
Text {
text: object.name
}
Text {
text: object.age
}
ListView {
model: model
delegate: chooser
Layout.fillWidth: true
Layout.fillHeight: true
}
}
}
Е
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import Qt.labs.qmlmodels 1.0
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
QtObject {
id: object
property string name
property int age
}
ListModel {
id: model
ListElement {
objectType: "string"
objectProperty: "name"
}
ListElement {
objectType: "number"
objectProperty: "age"
}
}
DelegateChooser {
id: chooser
role: "objectType"
DelegateChoice {
roleValue: "string"
delegate: TextField {
placeholderText: "Введите строку"
text: object[objectProperty]
onTextChanged: {
object[objectProperty] = text
}
}
}
DelegateChoice {
roleValue: "number"
delegate: TextField {
placeholderText: "Введите число"
text: object[objectProperty]
onTextChanged: {
object[objectProperty] = parseInt(text)
}
}
}
}
ColumnLayout {
anchors.fill: parent
Text {
text: object.name
}
Text {
text: object.age
}
ListView {
model: model
delegate: chooser
Layout.fillWidth: true
Layout.fillHeight: true
}
}
}
AS
Е
AS