Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QtQuick 2.0, read a QList<QString> from C++
Forum Updated to NodeBB v4.3 + New Features

QtQuick 2.0, read a QList<QString> from C++

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    osfesa
    wrote on last edited by
    #1

    Hi all.

    I'm having some issues with extending QtQuick 2.0 with C++.

    I want to show in a gridview, following this tutorial.
    I've done my changes and I wanna show in the gridview is a QList<QString>.
    I'm not using QQmlListProperty as in the tutorial, because I don't understand, and tried another solution. Also, in help says that is not recommended for production.

    My actual problem is that QML side doesn't know how many elements this QList has. I can see only one element on the gridview, the one I choose with this code:
    @
    text: egcView.allfiles[1]@

    The text to show is correct, if I change the index number I can see the diferent QStrings. So, I need a way to know the size of the list and show all the list.

    Any suggestion?

    Thanks all.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DRAX
      wrote on last edited by
      #2

      Have you tried:
      @egcView.allfiles.length@

      1 Reply Last reply
      0
      • O Offline
        O Offline
        osfesa
        wrote on last edited by
        #3

        [quote author="DRAX" date="1368091405"]Have you tried:
        @egcView.allfiles.length@[/quote]

        Thank you for your reply.

        I don't know where is the index iterator o which property.
        In the tutorial seems this task is made by QQmlListProperty. But in my gridview I don't know how to make this index or iterator.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved