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. Differences between ListModel and Repeater? Which type is better to implement a list of components containing controls?
Forum Updated to NodeBB v4.3 + New Features

Differences between ListModel and Repeater? Which type is better to implement a list of components containing controls?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 4.3k 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.
  • W Offline
    W Offline
    wuarmin
    wrote on last edited by wuarmin
    #1

    Hello,
    I have a QQmlListProperty containing QObjects. One attribute of these objects is a weekdayList(i.e M,S,S, for Monday, Saturday, Sunday). I implemented a qml-component to edit these weekDay-attribute(7 checkable buttons, one for every weekday, looks like the android alarm-clock).

    Now I want to show all objects in a ListView, or a Repeater and the delegate should also contain this editing-weekday-component. I tried it already with a ListView and it seems to work. The gui-component is rendered properly, but no interaction with the component takes place. The buttons aren't clickable.

    Maybe someone can give me some hints, how I can achieve my target and which of the qml-componente(ListView, Repeater) are appropriate.

    Thanks

    V 1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @wuarmin

      I tried it already with a ListView and it seems to work. The gui-component is rendered properly, but no interaction with the component takes place. The buttons aren't clickable.

      This sounds strange. Can you post the code ?

      Differences between ListModel and Repeater?

      Lots of. One of them being ListView's are scrollable, Repeaters are not. In fact it has a different funcionality. You can find more info comparing the documentation of both the components.

      157

      1 Reply Last reply
      1
      • W Offline
        W Offline
        wuarmin
        wrote on last edited by
        #3

        Ok, thank you for your response.

        So you mean, that use of editing controls in ListView-delegates should work?

        I'll post the code later...

        1 Reply Last reply
        0
        • W wuarmin

          Hello,
          I have a QQmlListProperty containing QObjects. One attribute of these objects is a weekdayList(i.e M,S,S, for Monday, Saturday, Sunday). I implemented a qml-component to edit these weekDay-attribute(7 checkable buttons, one for every weekday, looks like the android alarm-clock).

          Now I want to show all objects in a ListView, or a Repeater and the delegate should also contain this editing-weekday-component. I tried it already with a ListView and it seems to work. The gui-component is rendered properly, but no interaction with the component takes place. The buttons aren't clickable.

          Maybe someone can give me some hints, how I can achieve my target and which of the qml-componente(ListView, Repeater) are appropriate.

          Thanks

          V Offline
          V Offline
          vladstelmahovsky
          wrote on last edited by
          #4

          @wuarmin the main difference there is a time of instantiating delegates. if there is not clickable buttons in your listview, might be problem with your code

          1 Reply Last reply
          1
          • W Offline
            W Offline
            wuarmin
            wrote on last edited by
            #5

            Thank you for your help and the informations. The problem was that I put a mouse-area over the gui-controls.

            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