mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-02 14:14:10 +00:00
a2e1043149
A future ECM update is going to force that on us, so do it now anyway
40 lines
820 B
C++
40 lines
820 B
C++
#ifndef CLOSEDIALOGHELPER_H
|
|
#define CLOSEDIALOGHELPER_H
|
|
|
|
#include <QDialogButtonBox>
|
|
#include <QObject>
|
|
|
|
#include "../part/part.h"
|
|
|
|
namespace TestingUtils
|
|
{
|
|
/*
|
|
* The CloseDialogHelper class is a helper to auto close modals opened in tests.
|
|
*/
|
|
class CloseDialogHelper : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
CloseDialogHelper(Okular::Part *p, QDialogButtonBox::StandardButton b);
|
|
|
|
CloseDialogHelper(QWidget *w, QDialogButtonBox::StandardButton b);
|
|
|
|
// Close a modal dialog, which may not be associated to any other widget
|
|
explicit CloseDialogHelper(QDialogButtonBox::StandardButton b);
|
|
|
|
~CloseDialogHelper() override;
|
|
|
|
private Q_SLOTS:
|
|
void closeDialog();
|
|
|
|
private:
|
|
QWidget *m_widget;
|
|
QDialogButtonBox::StandardButton m_button;
|
|
bool m_clicked;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // CLOSEDIALOGHELPER_H
|