PDA

View Full Version : Centering a QCheckBox in a TableView



scarleton
5th July 2010, 15:17
I was having some issues getting the TableView to display a QCheckBox and have it interact correctly. Low and behold the issue was that I never implemented the set on the model. For anyone else having issues, I tweaked the querymodel example to have a selected field, here is the complete code:

4879

Q: How does one go about getting the QCheckBox to be centered in the TableView?

Sam

aamer4yu
6th July 2010, 07:04
Delegates, I guess :rolleyes:

scarleton
6th July 2010, 15:13
Well, there are two reasons I posted the code, in order of importance:

So others can see exactly how to use the Checked State in a table with the sql query model
So others can tinker with the code to figure the correct way of center the check box rather then just guessing.