KNewStuff

dialog.h
1/*
2 SPDX-FileCopyrightText: 2020-2023 Alexander Lohnau <alexander.lohnau@gmx.de>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KNEWSTUFF_QTQUICKDIALOGWRAPPER_H
8#define KNEWSTUFF_QTQUICKDIALOGWRAPPER_H
9
10#include <KNSCore/Entry>
11#include <KNSCore/ErrorCode>
12#include <QDialog>
13
14#include "knewstuffwidgets_export.h"
15
16namespace KNSCore
17{
18class EngineBase;
19};
20
21namespace KNSWidgets
22{
23class DialogPrivate;
24/**
25 * @class Dialog dialog.h <KNSWidgets/Dialog>
26 *
27 * This class is a wrapper around the QtQuick QML dialog. This dialog content is loaded QQuickWidget.
28 * It is recommended to reuse an instance of this class if it is expected that the user reopens the dialog.
29 * For most usecases, you should use KNSWidgets::Button or KNSWidgets::Action directly.
30 *
31 * @since 6.0
32 */
34{
35 Q_OBJECT
36
37public:
38 /**
39 * Constructs a new Dialog for the given config file and parent widget
40 */
41 explicit Dialog(const QString &configFile, QWidget *parent = nullptr);
42 ~Dialog() override;
43
44 /**
45 * Engine that is used by the dialog, might be null if the engine failed to initialize.
46 * @return KNSCore::EngineBase used by the dialog
47 */
49
50 /**
51 * Entries that were changed while the user interacted with the dialog
52 * @since 5.94
53 */
54 QList<KNSCore::Entry> changedEntries() const;
55
56 void open() override;
57
58private:
59 Q_PRIVATE_SLOT(d, void onEntryEvent(const KNSCore::Entry &entry, KNSCore::Entry::EntryEvent event))
60 const std::unique_ptr<DialogPrivate> d;
61
63};
64}
65
66#endif // KNEWSTUFF_QTQUICKDIALOGWRAPPER_H
KNewStuff engine.
Definition enginebase.h:52
KNewStuff data entry container.
Definition entry.h:48
This class is a wrapper around the QtQuick QML dialog.
Definition dialog.h:34
KNSCore::EngineBase * engine()
Engine that is used by the dialog, might be null if the engine failed to initialize.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:54:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.