小编bla*_*raz的帖子

从QML ListView中的TextEdit获取数据

我有一个问题,我找不到它的解决方案,我希望你在这里找到它:我做了一个ListView与它的模型及其委托等等,像这样:

Item {
id: creation;   width: parent.width ; height: parent.height
.....
ListView {
        id: mainViewLiist
        model: CreationModel {id: modelCreation}
        delegate: delegateCreation
        width: parent.width; height: parent.height;  x: -(screen.width * 1.5);
        cacheBuffer: 100;
    }
}
Run Code Online (Sandbox Code Playgroud)

委托包括Text,TextEdit等....这样的事情:

Component {
id: creationDelegate
Item {
    id: itemCreate
   ....
     Row {
                id: rowSerie
                spacing: 5
                Text {
                    id: seriesLabel
                    text: "Series:"
                    ....
                }

                TextEdit {
                    id: seriesTextEdit
                    text: ""
                    ....
                  }
           }
     .... 
    }
....
}
Run Code Online (Sandbox Code Playgroud)

在同一个项目"创建"中,还有一个带有两个按钮的工具栏,如下所示:

ToolBar { id: toolBarCreation; height: 40;
    width: parent.width;
    opacity: …
Run Code Online (Sandbox Code Playgroud)

listview textedit qml

1
推荐指数
1
解决办法
1596
查看次数

标签 统计

listview ×1

qml ×1

textedit ×1