File indexing completed on 2024-02-25 17:31:02

0001 /*  This file is part of the KDE project
0002     SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QEventLoop>
0010 #include <QObject>
0011 
0012 class QWindow;
0013 
0014 class QuickDialog : public QObject
0015 {
0016     Q_OBJECT
0017 public:
0018     QuickDialog(QObject *parent = nullptr);
0019     ~QuickDialog() override;
0020 
0021     QWindow *windowHandle() const
0022     {
0023         return m_theDialog;
0024     }
0025     bool exec();
0026 
0027     void create(const QString &file, const QVariantMap &props);
0028 
0029 public Q_SLOTS:
0030     void reject();
0031     void accept();
0032 
0033 protected:
0034     QWindow *m_theDialog = nullptr;
0035     QEventLoop m_execLoop;
0036 };