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. QComboBox in QTableWidget using QT Designer
QtWS25 Last Chance

QComboBox in QTableWidget using QT Designer

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.4k Views
  • 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.
  • P Offline
    P Offline
    Piyush
    wrote on last edited by
    #1

    Hi,

    I wanted to add a QComboBox on a particular cell in a QTableWidget using Qt Designer. However, I could not find any option on the property tab or maybe any functionality by which I can merge them.

    First Question: Is there any way by which I can achieve this using Qt Designer?

    As per my research, we can only add the QComboBox while programming, in my case, python. So, I added QcomboBoox dynamically within the QTableWidget through code. But, then I am not able to use the combobox signals.

    Second question: Can I capture signal when I add the combobox dynamically through the code?

    Screenshot of my table below:

    0_1521027768048_5db4c919-bc3f-47f1-95e1-842c0b19bf9c-image.png

    VRoninV 1 Reply Last reply
    0
    • P Piyush

      Hi,

      I wanted to add a QComboBox on a particular cell in a QTableWidget using Qt Designer. However, I could not find any option on the property tab or maybe any functionality by which I can merge them.

      First Question: Is there any way by which I can achieve this using Qt Designer?

      As per my research, we can only add the QComboBox while programming, in my case, python. So, I added QcomboBoox dynamically within the QTableWidget through code. But, then I am not able to use the combobox signals.

      Second question: Can I capture signal when I add the combobox dynamically through the code?

      Screenshot of my table below:

      0_1521027768048_5db4c919-bc3f-47f1-95e1-842c0b19bf9c-image.png

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

      @Piyush said in QComboBox in QTableWidget using QT Designer:

      First Question: Is there any way by which I can achieve this using Qt Designer?

      No

      Second question: Can I capture signal when I add the combobox dynamically through the code?

      You should not use setItemWidget but rather a delegate (via setItemDelegate). A C++ implementation can be found here:
      Header
      Source

      "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
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved