From 4c545793dab678d0abb9532e0413df09cc0e222a Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 8 Dec 2017 13:18:28 +0100 Subject: API docs: full working code, including workaround for Qt issue... --- src/gui/kwindowconfig.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/gui/kwindowconfig.h b/src/gui/kwindowconfig.h index 7879daba..03ae1efd 100644 --- a/src/gui/kwindowconfig.h +++ b/src/gui/kwindowconfig.h @@ -53,6 +53,15 @@ KCONFIGGUI_EXPORT void saveWindowSize(const QWindow *window, KConfigGroup &confi * you should first call winId() so that a QWindow is created, then you can call windowHandle() * to pass to this method. * + * Example code: + * @code + * winId(); // ensure there's a window created + * const QSize availableSize = windowHandle()->screen()->availableSize(); + * windowHandle()->resize(availableSize.width() * 0.7, availableSize.height() * 0.5); // default size + * KWindowConfig::restoreWindowSize(windowHandle(), KSharedConfig::openConfig()->group("MyDialog")); + * resize(windowHandle()->size()); // workaround for QTBUG-40584 + * @endcode + * * @note the group must be set before calling * * @param window The window to restore size. -- cgit v1.2.1