How do I resize QTableWidget?? I simply cannot find method name ... :confused::o
Printable View
How do I resize QTableWidget?? I simply cannot find method name ... :confused::o
Like every other widget
resize() - to resize it
move() - to move it
setGeometry() - to resize and move it from one call.
:)
god damn, today i'm so stupid .... thnaks man
But this resize() has no effect, I've inserted QTableWidget on parent widget via horizontal layout ... How to set width of QTableWidget so ScrollBar dissapears. How do I sum all header widths?
Depends how items you have you can calculate one item pixels and then just count them and resize the QTableWidget as much as you need. Maybe Qt have better way for that but I don't know it. :)
Widgets managed by layouts are not resizable by hand. Layout resizes widgets based on their size hints, size policies, min/max sizes etc. You might want to subclass QTableWidget and reimplement sizeHint() to return a suitable size hint so that the table doesn't have to show scroll bars. Both QTableView and QHeaderView contain methods to calculate required size.
I've set widget to be fixed size and and then I've called setFixedSize and now works!
What if the end-user has larger font than you?
Hmm, I was just thinking in your way, your remark is very good, thanks, but I have no idea how to reimplement sizeHint, I do not know what to put in this method ... Will do it your way, thanks.