Results 1 to 2 of 2

Thread: How to bind the listview using listelement with dynamic values?

  1. #1
    Join Date
    Jul 2016
    Posts
    53
    Thanks
    13
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default How to bind the listview using listelement with dynamic values?

    Hi all,

    I want to bind the listelement from .cpp file. The code below is static. I have an .xml file with itemTitle,ImageURL,itemId and I can read from xml. Now I want to pass the value from .cpp to .qml

    Query:
    1.What is the return type has to mention in .cpp file to bind with list element?

    How to bind the return type in ListElement component in .qml file.
    If possible code snippet please.

    Code Snippet:

    ListElement { itemTitle: "Housing with Mortgages"; imageUrl: "qrc:/Samples/Maps/OpenExistingMap/Housing.png"; itemId: "2d6fa24b357d427f9c737774e7b0f977"}
    ListElement { itemTitle: "USA Tapestry Segmentation"; imageUrl: "qrc:/Samples/Maps/OpenExistingMap/Tapestry.png"; itemId: "01f052c8995e4b9e889d73c3e210ebe3"}
    ListElement { itemTitle: "Geology of United States"; imageUrl: "qrc:/Samples/Maps/OpenExistingMap/geology.jpg"; itemId: "74a8f6645ab44c4f82d537f1aa0e375d"}

    Thanks in advance.

  2. #2
    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: How to bind the listview using listelement with dynamic values?

    You'll have to add some more context, there is no C++ code in your posting.

    Cheers,
    _

Similar Threads

  1. Dynamic values for qSin and qCos giving error
    By sreejithsjt in forum Qt Programming
    Replies: 7
    Last Post: 18th May 2016, 08:26
  2. Replies: 1
    Last Post: 26th April 2016, 14:46
  3. Replies: 1
    Last Post: 5th December 2015, 11:38
  4. Replies: 0
    Last Post: 22nd April 2011, 10:20
  5. ListView Dynamic Popup menu
    By raphaelf in forum Newbie
    Replies: 3
    Last Post: 14th October 2006, 19:26

Tags for this Thread

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.