Quantcast
Channel: Active questions tagged qtquick2 - Stack Overflow
Viewing all articles
Browse latest Browse all 107

Get TableView cell content

$
0
0

I would like to read specific data from a database, visualise the data in a table and write everything to another database.

But, I have some problems with reading the table. How do I get access to specific table cells?

import QtQuick 2.4import QtQuick.Window 2.2import QtQuick.Controls 1.3ApplicationWindow {    id: mainwindow    width: 400    height: 400    visible: true    Column {        Button {            id: printbutton            width: mainwindow.width            height: 30            text: "Print"            //Print TableView Cell            onClicked: console.log("tableview.row[1].column[1]")        }        ListModel {            id: libraryModel            ListElement{ title: "A Masterpiece" ; author: "Gabriel" }            ListElement{ title: "Brilliance"    ; author: "Jens" }            ListElement{ title: "Outstanding"   ; author: "Frederik" }        }        TableView {            width: mainwindow.width            height: mainwindow.height - printbutton.height            TableViewColumn{ role: "title"  ; title: "Title" ; width: 100 }            TableViewColumn{ role: "author" ; title: "Author" ; width: 200 }            model: libraryModel        }    }}

Viewing all articles
Browse latest Browse all 107

Trending Articles