KNewStuff

qtquickdialogwrapper.h
1 /*
2  SPDX-FileCopyrightText: 2020 Alexander Lohnau <[email protected]>
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/EntryInternal>
11 #include <KNSCore/ErrorCode>
12 #include <QObject>
13 
14 namespace KNSCore
15 {
16 class Engine;
17 }
18 
19 namespace KNS3
20 {
21 class QtQuickDialogWrapperPrivate;
22 /**
23  * This class is a wrapper around the QtQuick QML dialog. This dialog is loaded using the QQmlEngine.
24  * The constructor will create the QML component, to show the dialog the show() method must be called.
25  * It is recommended to reuse an instance of this class if it is expected that the user reopens the dialog.
26  * @since 5.78
27  */
28 class KNEWSTUFF_EXPORT QtQuickDialogWrapper : public QObject
29 {
30  Q_OBJECT
31 
32 public:
33  QtQuickDialogWrapper(const QString &configFile, QObject *parent = nullptr);
35 
36  /**
37  * Opens the dialog
38  */
39  void open();
40 
41  /**
42  * Similar to QDialog::exec. Shows the dialog and blocks until the user closes it.
43  * @return changedEntries, useful if you want to refresh the UI after entries were changed
44  * @see open
45  */
47 
48  /**
49  * This signal gets emitted when the dialog is closed
50  */
51  Q_SIGNAL void closed();
52 
53  /**
54  * Engine that is used by the dialog, might be null if the engine failed to initialize.
55  * @return KNSCore::Engine used by the dialog
56  */
57  KNSCore::Engine *engine();
58 
59 private:
60  std::unique_ptr<QtQuickDialogWrapperPrivate> d;
61 
62  Q_DISABLE_COPY(QtQuickDialogWrapper)
63 };
64 }
65 
66 #endif // KNEWSTUFF_QTQUICKDIALOGWRAPPER_H
Contains the core functionality for handling interaction with NewStuff providers. ...
Encapsulates a KNSCore::Engine for use in Qt Quick.
Definition: quickengine.h:24
This class is a wrapper around the QtQuick QML dialog.
KNewStuff engine.
Definition: engine.h:59
The namespace for the KNewStuff classes.
Definition: button.cpp:19
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun May 16 2021 22:42:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.