How do I resize QTableWidget?? I simply cannot find method name ...
How do I resize QTableWidget?? I simply cannot find method name ...
Qt 5.3 Opensource & Creator 3.1.2
Like every other widget
resize() - to resize it
move() - to move it
setGeometry() - to resize and move it from one call.
MarkoSan (12th January 2008)
god damn, today i'm so stupid .... thnaks man
Qt 5.3 Opensource & Creator 3.1.2
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?
Last edited by MarkoSan; 12th January 2008 at 18:42.
Qt 5.3 Opensource & Creator 3.1.2
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.
J-P Nurmi
MarkoSan (16th January 2008)
I've set widget to be fixed size and and then I've called setFixedSize and now works!
Qt 5.3 Opensource & Creator 3.1.2
What if the end-user has larger font than you?
J-P Nurmi
MarkoSan (16th January 2008)
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.
Qt 5.3 Opensource & Creator 3.1.2
Bookmarks