PDA

View Full Version : Qml java script



ganeshgladish
30th May 2013, 11:07
hi,
i have created array using javascript and stored some data ..i want to view this data in row and column like table view for my qml screen...please suggest any ideas...

wysota
30th May 2013, 11:34
Use the ListView element.

AlphaX2
3rd June 2013, 13:11
Due to the fact, QML has no TableView, the best way is to use a ListView and a delegate, which is showing it like a table. Depending on your data you can also create some Roles, to show the data.

AlphaX2

anda_skoa
3rd June 2013, 16:36
Due to the fact, QML has no TableView

Just to add a bit of precision: :)
QML does not have any UI at all, QtQuick's base component set has a ListView type and the QtQuickControl component set has a TableView type.

Cheers,
_

stereoMatching
5th June 2013, 04:02
Qt5.1 beta provide us tableView



import QtQuick 2.0
import QtQuick.Controls 1.0

Rectangle {
width: 640
height: 480

ListModel {
id: libraryModel
ListElement{ title: "A Masterpiece" ; author: "Gabriel" }
ListElement{ title: "Brilliance" ; author: "Jens" }
ListElement{ title: "Outstanding" ; author: "Frederik" }
}

TableView {
anchors.fill: parent
TableViewColumn{ role: "title" ; title: "Title" ; width: 100 }
TableViewColumn{ role: "author" ; title: "Author" ; width: 200 }
model: libraryModel
}
}


This is the example from the QtDocument

ganeshgladish
5th June 2013, 10:40
ya thanks to all i got output...i am using listview ...thanks u very much.....

ganeshgladish
7th June 2013, 16:52
i have created Qt c++ database ...i maintain some peoples data's...i also displayed this data to qml screen..in qml screen i have search option(textinput and button) .....whenever i click this search button with textinput name,it will retrieve and displayed how many same name persons in the table...now my questions this same name persons place i want to click and get that particular names data's ....how can i do i don't know please provide some solutions ....