QComboBox in QTableWidget using QT Designer



  • 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



  • @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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.