2020-02-10 23:22:06 +00:00
|
|
|
#ifndef CLOSEDIALOGHELPER_H
|
|
|
|
#define CLOSEDIALOGHELPER_H
|
|
|
|
|
|
|
|
#include <QDialogButtonBox>
|
|
|
|
#include <QObject>
|
|
|
|
|
2020-11-18 19:32:56 +00:00
|
|
|
#include "../part/part.h"
|
|
|
|
|
2020-02-10 23:22:06 +00:00
|
|
|
namespace TestingUtils
|
|
|
|
{
|
2020-07-10 22:15:05 +00:00
|
|
|
/*
|
2020-02-10 23:22:06 +00:00
|
|
|
* The CloseDialogHelper class is a helper to auto close modals opened in tests.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2020-02-10 23:22:06 +00:00
|
|
|
class CloseDialogHelper : public QObject
|
2020-07-10 22:15:05 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-02-10 23:22:06 +00:00
|
|
|
|
|
|
|
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
|
2021-08-21 23:14:34 +00:00
|
|
|
explicit CloseDialogHelper(QDialogButtonBox::StandardButton b);
|
2020-02-10 23:22:06 +00:00
|
|
|
|
|
|
|
~CloseDialogHelper() override;
|
|
|
|
|
2022-03-18 21:38:36 +00:00
|
|
|
private Q_SLOTS:
|
2020-02-10 23:22:06 +00:00
|
|
|
void closeDialog();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QWidget *m_widget;
|
|
|
|
QDialogButtonBox::StandardButton m_button;
|
|
|
|
bool m_clicked;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CLOSEDIALOGHELPER_H
|