qt: Add GUIUtil::ShowModalDialogAndDeleteOnClose
This commit is contained in:
2 files changed
+14
No files matched your search
@@ -36,6 +36,7 @@
|
|||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
#include <QDialog>
|
||||||
#include <QDoubleValidator>
|
#include <QDoubleValidator>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
@@ -958,4 +959,11 @@ void PrintSlotException(
|
|||||||
PrintExceptionContinue(exception, description.c_str());
|
PrintExceptionContinue(exception, description.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShowModalDialogAndDeleteOnClose(QDialog* dialog)
|
||||||
|
{
|
||||||
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
dialog->setWindowModality(Qt::ApplicationModal);
|
||||||
|
dialog->show();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace GUIUtil
|
} // namespace GUIUtil
|
||||||
@@ -41,6 +41,7 @@ class QAbstractButton;
|
|||||||
class QAbstractItemView;
|
class QAbstractItemView;
|
||||||
class QAction;
|
class QAction;
|
||||||
class QDateTime;
|
class QDateTime;
|
||||||
|
class QDialog;
|
||||||
class QFont;
|
class QFont;
|
||||||
class QKeySequence;
|
class QKeySequence;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
@@ -417,6 +418,11 @@ namespace GUIUtil
|
|||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows a QDialog instance asynchronously, and deletes it on close.
|
||||||
|
*/
|
||||||
|
void ShowModalDialogAndDeleteOnClose(QDialog* dialog);
|
||||||
|
|
||||||
} // namespace GUIUtil
|
} // namespace GUIUtil
|
||||||
|
|
||||||
#endif // BITCOIN_QT_GUIUTIL_H
|
#endif // BITCOIN_QT_GUIUTIL_H
|
||||||
Reference in new issue
Block a user