replacement for KDialog::[save|restore]DialogSize?

Thomas Lübking thomas.luebking at gmail.com
Sun Sep 14 21:50:32 BST 2014


On Sonntag, 14. September 2014 21:22:38 CEST, Aaron J. Seigo wrote:

> thanks. it's a little quirky: it doesn't work from the ctor of a QDialog 
> subclass...
You'll have to ensure that
a) there's a QWindow (call QWidget::winId())
b) the eventloop is up (once the Qt bug is fixed - until then copying the size to the widget is mandatory)

Both is usually the case for a delayed init, but not on "normal" construction.

Since we might want to re-add customStyleHint(.) etc. convenience functions to a KWidgetsAddons namespace, one could certainly add a thin KWidgetsAddons::[save|restore]WindowSize(QWidget*, .) that ensures the winId() part and works around the Qt bug until that gets fixed - the eventloop would remain to be ensured in KWindowConfig directly.

>> Dialog sized should also be maintained implicitly - see reviews 119594,
>
> they definitely aren't at the moment; would be great if they would be. 
I was probably wrong on this - you're operating on top of a custom QDialog rather than some KDE derivate, are you?
In that case it's probably not even reasonable to save/restore every random dialogs size (let alone to get the dialog a UID for the config key)

Cheers,
Thomas




More information about the kde-core-devel mailing list