Q
Q
qvlad2013-03-28 21:24:53
Qt
qvlad, 2013-03-28 21:24:53

QTableView in QML

The next question I want to throw in QML is the display of QTableView. I am especially interested in how to substitute my models there from qml, also implemented in C ++.
Something like that:

QmlTableView{
  anchors.fill: parent
  model:myModel
  enabled: true
  visible: true
  focus: true
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
epicfailguy93, 2013-03-29
@epicfailguy93

QtDesktopComponents has had a TableView for a long time . I checked, everything works.

S
SwitchMan, 2013-11-28
@SwitchMan

With QML, you can use either TabeView , which is part of QtQuick Controls, or develop your own QML component in c ++ ( an inheritor from QQuickPaintedItem), which is very difficult. At the same time, only list models are implemented in QML - ListModel, but you can also use custom models from QAbstractItemModel, which in fact should still be lists, but this is done by introducing custom roles - roles imitate columns, and thus a pseudo-table model is obtained, but since this method is the only one, it is considered acceptable. It's even more difficult with trees... Perhaps in the future the situation will change and new model classes will be added to QtQuick, but so far so. You will not throw any QTableView \ SqlTableModel in QML, in any way. And finally, advice - QML, it's not for corporate software, making it a database client (even if only UI) is a big mistake.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question