如何实现Tableview 数据筛选功能, 比如说根据关键字来决定需要显示的数据
示例代码如下.
import QtQuick 2.4import QtQuick.Controls 1.3import QtQuick.Window 2.2import QtQuick.Dialogs 1.2
ApplicationWindow { title: qsTr("Hello World") width: 640 height: 480 visible: true
ListModel { id: libraryModel ListElement { title: "A Masterpiece" author: "OK" } ListElement { title: "Brilliance" author: "NO" } ListElement { title: "Outstanding" author: "OK" } ListElement { title: "Otherthings" author: "NO" } } TableView { TableViewColumn { role: "title" title: "Title" width: 100 } TableViewColumn { role: "author" title: "Author" width: 200 } model: libraryModel }
CheckBox { id: checkBox1 x: 285 y: 55 text: qsTr("Check Box") }}