[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-frameworks-devel
Subject: restore dialog sizes and QTBUG-40584
From: Alexander Semke <alexander.semke () web ! de>
Date: 2019-01-25 8:26:15
Message-ID: 516160341.3plWr6NDKe () notebook
[Download RAW message or body]
Hi,
after having read the documentation of KWindowConfig::restoreWindowSize(), I
understood how to properly restore the dialog sizes. I'm in a process of fixing
this now in LabPlot (20 dialogs or so):
https://cgit.kde.org/labplot.git/commit/?
id=ebfa6b4243dec41b6c656483a57401de4b387793
https://cgit.kde.org/labplot.git/commit/?
id=817125ca5f2c3d1141e52342e9e0239ea9f4f4ed
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 year
with "Incomplete" even though David actually provided enough information...
--
Alexander
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic