How can I add a checkbox/radiobutton/combobox to a QTableWidget or a QListWidget?
How can I add a checkbox/radiobutton/combobox to a QTableWidget or a QListWidget?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For a checkbox using the item’s setCheckState method should do what you need both for list and table widgets. See if code below would work for you:
List widget:
Table widget:
You can use delegates (QItemDelegate) for other types of editor’s widgets, example is here: Spin Box Delegate Example.
I hope this helps.