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. How to update Qcombobox delegate ?

How to update Qcombobox delegate ?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 590 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.
  • N Offline
    N Offline
    n-2204
    wrote on last edited by
    #1

    Hi,

    I have Qcombobox delegate and using that to set delegate for a row in a Qtableview (Qabstractitemmodel).
    but i have to access the combobox delegate to change index in combobox.
    How can i access the combobox an update the index ? this index is update on some condition

    I have tried findchild and indexWidget and tried to access delegate but not succeed to get the index.

    ComboDelegate* itemDelegate = (ComboDelegate*)m_DataView->itemDelegateForRow(5);

    Plz suggest how to do..
    Thankyou

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

      Hi,

      When do you want to change the index ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      N 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        When do you want to change the index ?

        N Offline
        N Offline
        n-2204
        wrote on last edited by n-2204
        #3

        @SGaist I have one more combo box[outside qtableview not a delegate] with that change in selection I have to update combo delegate [this is in qtableview] index.

        VRoninV 1 Reply Last reply
        0
        • N n-2204

          @SGaist I have one more combo box[outside qtableview not a delegate] with that change in selection I have to update combo delegate [this is in qtableview] index.

          VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          @n-2204 said in How to update Qcombobox delegate ?:

          combo delegate

          The delegate is not really a combobox, only when the user goes and edits the cell it actually becomes one so you just have to call setData on the undelying model holding the data

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          3
          • N Offline
            N Offline
            n-2204
            wrote on last edited by
            #5

            Ya thanks for response I have implemented the same way..

            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