A
A
Anton2018-07-12 07:38:57
Python
Anton, 2018-07-12 07:38:57

How to add a checkbox to a QTableWidgetItem class in PyQt5?

How to add a checkbox to a QTableWidgetItem class in PyQt5?
To be more precise, it is also necessary to immediately create rows in the table. Well, I can create something more or less :)
Like this:

QTmainForm.tablemainWidget.setItem(numOutSQLrequest, 2, QTableWidgetItem(', '.join(CommentErr)))

How to create a cell with a checkbox in it?
And it would not be bad to tell how to interact with this checkbox later?
And the fact that I can’t find information on this issue on the Internet :(
Can you tell me what kind of book to read about PyQt5? Otherwise, besides PyQt Prokhorenka, I didn’t find anything worthwhile anymore :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2018-07-12
@8toni8

Found the answer.
We create a checkbox.
And put it in a table cell:

QTmainForm.tablemainWidget.setCellWidget(1, 2, CheckBox)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question