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. How to test qml listview with qml TestCase.

How to test qml listview with qml TestCase.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 220 Views
  • 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.
  • J Offline
    J Offline
    Jim Gir
    wrote on last edited by
    #1

    Hi,
    2 questions about testing lisview :

    • When using QAbstractModel, how is the role accessible ? I meann, if I have a listview instance, how can I access for example the display value of the currentItem ? Which is obejct is the parent of display ?

    • I have this kind of conditional delegate : how can I access the current delegate to test if the good type Is created. I tried myListView.currentItem.item but It returns undefined.

    delegate: Component {
        Loader {
          sourceComponent: switch (display.classtype) {
            case "ImageSection": {
              return imageDelegate
            }
            case "TextSection" : {
              return textDelegate
            }
          }
        }
      }
    

    thanks
    Jimmy

    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