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 create a QComboBox that displays widgets?
Forum Updated to NodeBB v4.3 + New Features

How to create a QComboBox that displays widgets?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.8k 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.
  • R Offline
    R Offline
    roygual
    wrote on last edited by
    #1

    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
    0
    • D Offline
      D Offline
      draconis
      wrote on last edited by
      #2

      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
      0
      • R Offline
        R Offline
        roygual
        wrote on last edited by
        #3

        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
        0
        • D Offline
          D Offline
          draconis
          wrote on last edited by
          #4

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

          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