我想使用PyQt5获得QML表视图选择的Python表示。我还没有找到一个简单的解决办法。在
假设以下示例文件:
main_窗口.qml
ApplicationWindow {
// ...
signal selectionChanged()
property alias tableSelection: tableView.selection
TableView{
id: tableView
model: []
selectionMode: SelectionMode.ContiguousSelection
selection.onSelectionChanged: selectionChanged()
}
}
main_窗口.py
^{pr2}$get_table_selection()
返回一个QObject,这不是我想要的。在
如果可能,我希望将表选择作为(选定的)索引的Python列表来访问。这可能吗?如果是,最好的方法是什么?在
提前谢谢你的帮助。在
目前没有回答
相关问题 更多 >
编程相关推荐