KConfig 5.109.0
|
Save and load window sizes into a config. More...
Functions | |
void | restoreWindowPosition (QWindow *window, const KConfigGroup &config) |
Restores the window's screen position from the configuration and calls restoreWindowScreenPosition. | |
void | restoreWindowScreenPosition (QWindow *window, const QScreen *screen, const KConfigGroup &config) |
Restores the window's position on provided screen from the configuration. | |
void | restoreWindowSize (QWindow *window, const KConfigGroup &config) |
Restores the dialog's size from the configuration according to the screen size. | |
void | saveWindowPosition (const QWindow *window, KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal) |
Saves the window's position either to the global or application config file. | |
void | saveWindowSize (const QWindow *window, KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal) |
Saves the window's size dependent on the screen dimension either to the global or application config file. | |
Save and load window sizes into a config.
void KWindowConfig::restoreWindowPosition | ( | QWindow * | window, |
const KConfigGroup & | config | ||
) |
Restores the window's screen position from the configuration and calls restoreWindowScreenPosition.
This function has no effect on Wayland, where the compositor is responsible for window positioning.
window | The window whose position to restore. |
config | The config group to read from. |
void KWindowConfig::restoreWindowScreenPosition | ( | QWindow * | window, |
const QScreen * | screen, | ||
const KConfigGroup & | config | ||
) |
Restores the window's position on provided screen from the configuration.
This function has no effect on Wayland, where the compositor is responsible for window positioning.
window | The window whose position to restore. |
screen | Screen on which window should be placed. |
config | The config group to read from. |
void KWindowConfig::restoreWindowSize | ( | QWindow * | window, |
const KConfigGroup & | config | ||
) |
Restores the dialog's size from the configuration according to the screen size.
If you're calling this from a constructor (for a mainwindow or dialog, for instance) you should first call winId() so that a QWindow is created, then you can call windowHandle() to pass to this method.
Example code:
window | The window to restore size. |
config | The config group to read from. |
void KWindowConfig::saveWindowPosition | ( | const QWindow * | window, |
KConfigGroup & | config, | ||
KConfigGroup::WriteConfigFlags | options = KConfigGroup::Normal |
||
) |
Saves the window's position either to the global or application config file.
This function has no effect on Wayland, where the compositor is responsible for window positioning.
window | The window whose position to save. |
config | The config group to read from. |
options | passed to KConfigGroup::writeEntry() |
void KWindowConfig::saveWindowSize | ( | const QWindow * | window, |
KConfigGroup & | config, | ||
KConfigGroup::WriteConfigFlags | options = KConfigGroup::Normal |
||
) |
Saves the window's size dependent on the screen dimension either to the global or application config file.
window | The window to save size. |
config | The config group to read from. |
options | passed to KConfigGroup::writeEntry() |