diff options
author | David Faure <faure@kde.org> | 2017-12-08 13:18:28 +0100 |
---|---|---|
committer | David Faure <faure@kde.org> | 2017-12-08 13:18:28 +0100 |
commit | 4c545793dab678d0abb9532e0413df09cc0e222a (patch) | |
tree | 124395fb4a866422c30756c81bfd567dd93093bd | |
parent | 9dd072ae3680a96e52a1704caa843a198cd459dc (diff) | |
download | kconfig-4c545793dab678d0abb9532e0413df09cc0e222a.tar.gz kconfig-4c545793dab678d0abb9532e0413df09cc0e222a.tar.bz2 |
API docs: full working code, including workaround for Qt issue...
-rw-r--r-- | src/gui/kwindowconfig.h | 9 |
1 files changed, 9 insertions, 0 deletions
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. |