[Qt-interest] Halfautomatic column-sizing

Andreas Pakulat apaku at gmx.de
Sun Feb 14 22:21:51 CET 2010


Hi,

I'm wondering how other people handle the following with regard to
QTableView and its column-sizing:

1. The user should be able to resize the columns as he see's fit. This
is going to be stored with the application data and restored on the next
app start

2. The default size of columns (as long as the user didn't change it
manually) should be a app-defined relation (i.e. something like 5:3:3)
and the actual sizes should be such that the complete width of the
tableview is taken, but no scrollbars are shown.

Right now my solution is to start a single-shot timer on app startup
that first sizes the columns and then restores the applications state.
I'm just wondering wether there's something more elegant, especially
since there's a potential race if the timeout is too short and a flicker
if the timeout is too long.

Andreas

-- 
Avoid reality at all costs.



More information about the Qt-interest-old mailing list