Results 1 to 7 of 7

Thread: Qml java script

  1. #1
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qml java script

    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...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qml java script

    Use the ListView element.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2013
    Location
    Dresden - Germany
    Posts
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Qml java script

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qml java script

    Quote Originally Posted by AlphaX2 View Post
    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,
    _

  5. #5
    Join Date
    Jan 2011
    Posts
    127
    Thanks
    42
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qml java script

    Qt5.1 beta provide us tableView

    Qt Code:
    1. import QtQuick 2.0
    2. import QtQuick.Controls 1.0
    3.  
    4. Rectangle {
    5. width: 640
    6. height: 480
    7.  
    8. ListModel {
    9. id: libraryModel
    10. ListElement{ title: "A Masterpiece" ; author: "Gabriel" }
    11. ListElement{ title: "Brilliance" ; author: "Jens" }
    12. ListElement{ title: "Outstanding" ; author: "Frederik" }
    13. }
    14.  
    15. TableView {
    16. anchors.fill: parent
    17. TableViewColumn{ role: "title" ; title: "Title" ; width: 100 }
    18. TableViewColumn{ role: "author" ; title: "Author" ; width: 200 }
    19. model: libraryModel
    20. }
    21. }
    To copy to clipboard, switch view to plain text mode 

    This is the example from the QtDocument

  6. #6
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qml java script

    ya thanks to all i got output...i am using listview ...thanks u very much.....

  7. #7
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qml java script

    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 ....

Similar Threads

  1. Replies: 4
    Last Post: 4th August 2011, 12:47
  2. Replies: 0
    Last Post: 4th August 2011, 11:37
  3. Auto login using java script
    By johnsoga in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2011, 11:06
  4. Running java script in QtWebKit makes GUI sluggish
    By calium in forum Qt Programming
    Replies: 0
    Last Post: 26th August 2010, 09:35
  5. Java Script on Qt4.5
    By kavinsiva in forum Newbie
    Replies: 1
    Last Post: 7th October 2009, 13:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.