Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, August 2007
Saving/restoring QTreeView state (Qt 4.3 )


Message 1 in thread

Hi people,

In my application i need to save and restore a QTreeView whole state, 
for instance when the project is saved then loaded, QTreeView's columns 
widths, expanded/collapsed indexes, selected indexes, hidden 
rows/columns etc ... must be restored.

Basically it means i will have to loop on each column, save its width, 
then each row, save its height, then all indexes, etc ... which is not a 
really hard, but definitely a boring job.

Does anyone know a better way to handle the views' state save and restore ?

Thanks for any suggestions,
Regards,

Michael

--
 [ signature omitted ] 

Message 2 in thread

On Thursday 02 August 2007 17:02:13 Michael Palomas wrote:
> Hi people,
>
> In my application i need to save and restore a QTreeView whole state,
> for instance when the project is saved then loaded, QTreeView's columns
> widths, expanded/collapsed indexes, selected indexes, hidden
> rows/columns etc ... must be restored.
>
> Basically it means i will have to loop on each column, save its width,
> then each row, save its height, then all indexes, etc ... which is not a
> really hard, but definitely a boring job.
>
> Does anyone know a better way to handle the views' state save and restore ?

At least for the header (columns) you can use the new 
saveState()/restoreState() function that was added in 4.3.

-Benjamin Meyer



--
 [ signature omitted ]