Qt Forum

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

    How to create a QComboBox that displays widgets?

    General and Desktop
    2
    4
    2469
    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.
    • R
      roygual last edited by

      Is it posible subclassing QComboBox enabling to display some functional widgets instead of only icons & text,...

      for example, clicking the combobox displays a bunch of QRadioButtons, or QPushButtons, images, ... customWidgets, etc all widgets within should be usable and functional.

      maybe a clue could be with QStandardItemModel but it still confusing for me.

      or

      I should create a custom widget creating something like a combo QScrollarea and a QPushButton and manualy add some functionallity??

      maybe it's an obvious question but I'm a newbie and I want to take the correct path and learn from you guys

      In Advance

      Thank you!!!!!

      1 Reply Last reply Reply Quote 0
      • D
        draconis last edited by

        Look at the examples for using QItemDelegate. A simple use of QItemDelegate can be found in the Qt examples/itmeviews/spinboxdelegate. You can find other examples on the web as well.

        1 Reply Last reply Reply Quote 0
        • R
          roygual last edited by

          Hi draconis

          I ask you for huge apology for taking so long to respond,

          I've reviewed the examples and are quite clear, actually they gave me a clear track of how to do it.
          Now my problem is that the combobox does not paint the buttons or radiobuttons, I only managed to do it when I'm editing the item and thats when it is editable like within a qtableview, I wish that widgets (button, radiobuttons) where visible all the time.

          the documentation will help me.

          thank you very much for your help

          1 Reply Last reply Reply Quote 0
          • D
            draconis last edited by

            You are welcome. Hope you are having success with your project.

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