QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskDialogWindow.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_DIALOG_WINDOW_H
7#define QSK_DIALOG_WINDOW_H
8
9#include "QskDialog.h"
10#include "QskWindow.h"
11
13class QskPushButton;
14
15class QSK_EXPORT QskDialogWindow : public QskWindow
16{
17 Q_OBJECT
18
19 Q_PROPERTY( QskDialog::Actions dialogActions
20 READ dialogActions WRITE setDialogActions )
21
22 using Inherited = QskWindow;
23
24 public:
25 QskDialogWindow( QWindow* parent = nullptr );
26 ~QskDialogWindow() override;
27
28 QskDialog::Actions dialogActions() const;
29 void setDialogActions( QskDialog::Actions );
30
31 Q_INVOKABLE QskDialog::Action clickedAction() const;
32
33 Q_INVOKABLE QskDialog::DialogCode result() const;
34 Q_INVOKABLE QskDialog::DialogCode exec();
35
36 void setDefaultDialogAction( QskDialog::Action );
37
38 void setDefaultButton( QskPushButton* );
39 QskPushButton* defaultButton() const;
40
41 QskDialogButtonBox* buttonBox();
42 const QskDialogButtonBox* buttonBox() const;
43
44 void setDialogContentItem( QQuickItem* );
45 QQuickItem* dialogContentItem() const;
46
47 Q_SIGNALS:
48 void finished( QskDialog::DialogCode result );
49 void accepted();
50 void rejected();
51
52 public Q_SLOTS:
53 void accept();
54 void reject();
55
56 virtual void done( QskDialog::DialogCode );
57
58 protected:
59 void setResult( QskDialog::DialogCode r );
60 virtual QskDialogButtonBox* createButtonBox();
61
62 bool event( QEvent* ) override;
63 void keyPressEvent( QKeyEvent* ) override;
64
65 private:
66 class PrivateData;
67 std::unique_ptr< PrivateData > m_data;
68};
69
70#endif