KConfig

kwindowstatesaverquick.h
1// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
2// SPDX-License-Identifier: LGPL-2.0-or-later
3
4#ifndef KWINDOWSTATESAVER_QUICK_H
5#define KWINDOWSTATESAVER_QUICK_H
6
7#include <QQmlEngine>
8
9/**
10 * @brief Creates a @c KWindowStateSaver in QML, and assigns it to the window it's parented to.
11 *
12 * Functions exactly as KWindowStateSaver in C++, as it's a small wrapper around it.
13 *
14 * @code
15 * import org.kde.config as KConfig
16 *
17 * Kirigami.ApplicationWindow {
18 * id: root
19 *
20 * title: i18n("My Window")
21 *
22 * KConfig.WindowStateSaver {
23 * configGroupName: "Main"
24 * }
25 * }
26 * @endcode
27 * @since 6.5
28 *
29 * @sa KWindowStateSaver
30 */
32{
34 QML_ELEMENT
35 QML_NAMED_ELEMENT(WindowStateSaver)
37
38 Q_PROPERTY(QString configGroupName READ configGroupName WRITE setConfigGroupName NOTIFY configGroupNameChanged REQUIRED)
39
40public:
41 void classBegin() override;
42 void componentComplete() override;
43
44 void setConfigGroupName(const QString &name);
45 QString configGroupName() const;
46
48 void configGroupNameChanged();
49
50private:
51 QString m_configGroupName;
52};
53
54#endif
Creates a KWindowStateSaver in QML, and assigns it to the window it's parented to.
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:49:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.