Unsolved Custom table model with checkbox
-
Hello everyone,
I have created my custom table model based on QAbstractTableModel and it contains checkbox which works as it is supposed to and only issue is empty text field next to it.
Is there any way to remove that space , and could please someone explain that.
I would like to have just a checkbox centered in the column.Big thank you in advance!
-
Hi,
You can add handling of the
Qt::SizeHintRole
role to your model and give something more suitable. -
@SGaist said in Custom table model with checkbox:
Qt::SizeHintRole
Thank you for helping. So It seems that it is solving the thing partially, still that Free area stays, for some reason checkbox includes text space which has no use at all. Any way to remove that text space?
-
Is it read-only or is the checkbox clickable by the user?
-
Yes, it is user clickable. User can change state of sensor with this (in the future).