Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Add item outside of model to GridView

    QML and Qt Quick
    2
    4
    315
    Loading More Posts
    • 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.
    • M
      maxwell31 last edited by maxwell31

      Hi,

      I use a GridView to display a model, which creates buttons. However, I need to add another item (a button of a different type, outside of the model, created in qml) to this GridView. Is this possible?

      I tried using a Grid as Child of a Flickable, but there I don't know how to make it snap to rows.

      1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

        Both can't be done. Now any reason you would like add the different button to view ? Can you tell us what you wanted to achieve ? It may help us give you solution with GridView itself.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply Reply Quote 0
        • M
          maxwell31 last edited by

          Basically it is for controlling a machine via a touch screen. The machine has several programs. I have a model for these programs which I display through my own ProgramButton delegate in a GridView. As there are many programs, the GridView has several columns and rows and it is possible to flick through the columns. The design team demanded, that we also add some general buttons into the GridView which can perform other actions not related to the programs. The problem is, that these additional buttons have nothing in common with my ProgramButton, so incorporating them into the model seems like evil hacking.

          This is why a Grid would be appropriate. I could simply make a Repeater for my ProgramButtons and add the other buttons after the Repeater. But as I said, there I would have the problem of snapping

          1 Reply Last reply Reply Quote 0
          • dheerendra
            dheerendra Qt Champions 2022 last edited by dheerendra

            When you say 'additional buttons', I'm assuming that all have similar characterstics. For this can try making the conditional delagates.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            1 Reply Last reply Reply Quote 0
            • First post
              Last post