okular/autotests/closedialoghelper.h
Albert Astals Cid a2e1043149 slots -> Q_SLOTS
A future ECM update is going to force that on us, so do it now anyway
2022-03-19 10:58:47 +00:00

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