qskinny/src/dialogs/QskDialogWindow.h

71 lines
1.8 KiB
C
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef QSK_DIALOG_WINDOW_H
#define QSK_DIALOG_WINDOW_H 1
#include "QskDialog.h"
2018-08-03 08:15:28 +02:00
#include "QskWindow.h"
2018-11-06 18:54:21 +01:00
class QskDialogButtonBox;
class QskPushButton;
2017-07-21 18:21:34 +02:00
class QSK_EXPORT QskDialogWindow : public QskWindow
{
Q_OBJECT
2018-11-06 18:54:21 +01:00
Q_PROPERTY( QskDialog::Actions dialogActions
READ dialogActions WRITE setDialogActions )
2017-07-21 18:21:34 +02:00
using Inherited = QskWindow;
2018-08-03 08:15:28 +02:00
public:
2017-07-21 18:21:34 +02:00
QskDialogWindow( QWindow* parent = nullptr );
2018-07-31 17:32:25 +02:00
~QskDialogWindow() override;
2017-07-21 18:21:34 +02:00
2018-11-06 18:54:21 +01:00
QskDialog::Actions dialogActions() const;
void setDialogActions( QskDialog::Actions );
Q_INVOKABLE QskDialog::Action clickedAction() const;
2017-07-21 18:21:34 +02:00
Q_INVOKABLE QskDialog::DialogCode result() const;
Q_INVOKABLE QskDialog::DialogCode exec();
2018-11-06 18:54:21 +01:00
void setDefaultDialogAction( QskDialog::Action );
void setDefaultButton( QskPushButton* );
QskPushButton* defaultButton() const;
QskDialogButtonBox* buttonBox();
const QskDialogButtonBox* buttonBox() const;
void setDialogContentItem( QQuickItem* );
QQuickItem* dialogContentItem() const;
2018-08-03 08:15:28 +02:00
Q_SIGNALS:
2017-07-21 18:21:34 +02:00
void finished( QskDialog::DialogCode result );
void accepted();
void rejected();
2018-08-03 08:15:28 +02:00
public Q_SLOTS:
2017-07-21 18:21:34 +02:00
void accept();
void reject();
2019-03-01 14:20:56 +01:00
virtual void done( QskDialog::DialogCode );
2018-08-03 08:15:28 +02:00
protected:
2017-07-21 18:21:34 +02:00
void setResult( QskDialog::DialogCode r );
2018-11-06 18:54:21 +01:00
virtual QskDialogButtonBox* createButtonBox();
2017-07-21 18:21:34 +02:00
2018-07-31 17:32:25 +02:00
bool event( QEvent* ) override;
void keyPressEvent( QKeyEvent* ) override;
2017-07-21 18:21:34 +02:00
2018-08-03 08:15:28 +02:00
private:
2017-07-21 18:21:34 +02:00
class PrivateData;
std::unique_ptr< PrivateData > m_data;
};
#endif