Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Dynamic ComboBox Delagate?
Forum Updated to NodeBB v4.3 + New Features

Dynamic ComboBox Delagate?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 622 Views 2 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.
  • MucipM Offline
    MucipM Offline
    Mucip
    wrote on last edited by
    #1

    Hi,
    Finally I got to use ComboBox delagate in tableview. But this combobox is static. I mean, I got table and I read the rows.
    But I need Dynamic content now. The content of the combobox need to change depens on the value of column 1 in the tableview.
    So everytime the content must re-fill depends on user input on column 1 of the tableview.

    Is there any good idea to get this?...

    Regards,Mucip:)

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      You can do it in
      http://doc.qt.io/qt-5/qabstractitemdelegate.html#setEditorData
      The index you get contains
      http://doc.qt.io/qt-5/qmodelindex.html#model
      so you can query the model data.

      1 Reply Last reply
      1
      • MucipM Offline
        MucipM Offline
        Mucip
        wrote on last edited by
        #3

        Hi,
        I do not want to set content of the delagate. I already do it.
        I want to re-fill content of the combobox in each row depends on first cell value of the tableview...

        Regardgs,
        Mucip:)

        mrjjM 1 Reply Last reply
        0
        • MucipM Mucip

          Hi,
          I do not want to set content of the delagate. I already do it.
          I want to re-fill content of the combobox in each row depends on first cell value of the tableview...

          Regardgs,
          Mucip:)

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @Mucip
          Yep and that is exactly what setEditorData is for.
          setting the items in the combobox before its shown.

          1 Reply Last reply
          2
          • MucipM Offline
            MucipM Offline
            Mucip
            wrote on last edited by
            #5

            Hi,
            I see... Ok.
            I'll try. Thanks...

            Regards,
            Mucip:)

            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