You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
820 B
39 lines
820 B
#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
|
|
|