KDE file dialog column resize no longer possible?

René J.V. Bertin rjvbertin at gmail.com
Fri Jan 18 20:56:30 GMT 2019


Hi,

>Assistance would be appreciated. :-)

I've whipped up something, a bit sneaky but it does more or less what I had in mind.

- the QEvent::Polish handler connects to the sectionResized signal
- this sectionResized slot will check if the QTreeView contains a positive number of elements, if the new size is positive and if the current resize mode is not already "Interactive". If so, it sets the current section to interactive resize and sets the new size explictly.
- somehow this per-column change does not have the intended effect (when done here, with Qt 5.9 and FW 5.52.0), so a class state variable is toggled too
- at an appropriate moment the entire QHeaderView is set to interactive mode if that state variable is true. The first QPaintEvent should come after the section widths have been determined and turns out to be just in time to get actually resizable sections.

I haven't checked in depth if there are side-effects but this works good enough for me (as a first draft). The only thing I'd like to see added is the persistence of the column widths I mentioned earlier: save the widths of any columns the user resized manually, and use those values when the dialog is reopened.

Let me know what you think; should I put this on phab?

R.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-kio-filedialog-resize-columns.diff
Type: text/x-patch
Size: 4242 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190118/268c6f88/attachment.bin>


More information about the Kde-frameworks-devel mailing list