From kde-frameworks-devel Fri Jan 25 08:26:15 2019 From: Alexander Semke Date: Fri, 25 Jan 2019 08:26:15 +0000 To: kde-frameworks-devel Subject: restore dialog sizes and QTBUG-40584 Message-Id: <516160341.3plWr6NDKe () notebook> X-MARC-Message: https://marc.info/?l=kde-frameworks-devel&m=154840479331729 Hi, after having read the documentation of KWindowConfig::restoreWindowSize(),= I understood how to properly restore the dialog sizes. I'm in a process of f= ixing this now in LabPlot (20 dialogs or so): https://cgit.kde.org/labplot.git/commit/? id=3Debfa6b4243dec41b6c656483a57401de4b387793 https://cgit.kde.org/labplot.git/commit/? id=3D817125ca5f2c3d1141e52342e9e0239ea9f4f4ed Basically, the pattern I need to add now everywhere is something like this= : //restore saved settings if available create(); // ensure there's a window created KConfigGroup conf(KSharedConfig::openConfig(), "FunctionValuesDialog"); if (conf.exists()) { KWindowConfig::restoreWindowSize(windowHandle(), conf); resize(windowHandle()->size()); // workaround for QTBUG-40584 } else resize(QSize(300, 0).expandedTo(minimumSize())); I'm wondering why not to move this logic completely into KWindowConfig::restoreWindowSize() so that in the application code, until QTBUG-40584 is adressed, we can simply do KConfigGroup conf(KSharedConfig::openConfig(), "FunctionValuesDialog"); KWindowConfig::restoreWindowSize(windowHandle(), conf); Were there any arguments against this? https://bugreports.qt.io/browse/QTBUG-40584 - this one was closed last yea= r with "Incomplete" even though David actually provided enough information..= . =2D- Alexander