mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
qt: Add GUIUtil::ShowModalDialogAndDeleteOnClose
This commit is contained in:
parent
503194d2ee
commit
13f618818d
2 changed files with 14 additions and 0 deletions
|
@ -36,6 +36,7 @@
|
|||
#include <QClipboard>
|
||||
#include <QDateTime>
|
||||
#include <QDesktopServices>
|
||||
#include <QDialog>
|
||||
#include <QDoubleValidator>
|
||||
#include <QFileDialog>
|
||||
#include <QFont>
|
||||
|
@ -958,4 +959,11 @@ void PrintSlotException(
|
|||
PrintExceptionContinue(exception, description.c_str());
|
||||
}
|
||||
|
||||
void ShowModalDialogAndDeleteOnClose(QDialog* dialog)
|
||||
{
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dialog->setWindowModality(Qt::ApplicationModal);
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
} // namespace GUIUtil
|
||||
|
|
|
@ -41,6 +41,7 @@ class QAbstractButton;
|
|||
class QAbstractItemView;
|
||||
class QAction;
|
||||
class QDateTime;
|
||||
class QDialog;
|
||||
class QFont;
|
||||
class QKeySequence;
|
||||
class QLineEdit;
|
||||
|
@ -417,6 +418,11 @@ namespace GUIUtil
|
|||
type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a QDialog instance asynchronously, and deletes it on close.
|
||||
*/
|
||||
void ShowModalDialogAndDeleteOnClose(QDialog* dialog);
|
||||
|
||||
} // namespace GUIUtil
|
||||
|
||||
#endif // BITCOIN_QT_GUIUTIL_H
|
||||
|
|
Loading…
Add table
Reference in a new issue