QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
windowstatestore.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
8#ifndef SRC_WINDOWSTATESTORE_H_
9#define SRC_WINDOWSTATESTORE_H_
10
11#include <QString>
12
13class QDialog;
14class QWidget;
15
27namespace WindowStateStore {
28
39auto restore(QWidget &window, const QString &key) -> bool;
40
46void save(const QWidget &window, const QString &key);
47
57void attach(QDialog &dialog, const QString &key);
58
65void centreOnCursorScreen(QWidget &window);
66
67} // namespace WindowStateStore
68
69#endif // SRC_WINDOWSTATESTORE_H_
Persist and restore a top-level window's geometry, one way for the main window and every dialog.
void save(const QWidget &window, const QString &key)
Save window's geometry under key.
auto restore(QWidget &window, const QString &key) -> bool
Restore window's geometry saved under key.
void centreOnCursorScreen(QWidget &window)
Move window so its frame is centred on the screen under the mouse pointer (the primary screen when th...
void attach(QDialog &dialog, const QString &key)
restore() now, save() whenever the dialog finishes.