handle messageboxes inside qt's thread

This commit is contained in:
Joakim L. Gilje
2021-11-29 12:25:27 +01:00
parent 97d844c3fc
commit 238fb7ef62
4 changed files with 12 additions and 11 deletions

View File

@@ -3,8 +3,6 @@
extern "C" {
#include <86box/86box.h>
//#include <86box/keyboard.h>
//#include <86box/mouse.h>
#include <86box/config.h>
#include <86box/plat.h>
@@ -15,6 +13,7 @@ extern "C" {
#include <QDebug>
#include <QTimer>
#include <QKeyEvent>
#include <QMessageBox>
#include "qt_settings.hpp"
@@ -26,6 +25,11 @@ MainWindow::MainWindow(QWidget *parent) :
ui->setupUi(this);
connect(this, &MainWindow::showMessage, this, [this](const QString& header, const QString& message) {
QMessageBox box(QMessageBox::Warning, header, message, QMessageBox::NoButton, this);
box.exec();
}, Qt::BlockingQueuedConnection);
connect(this, &MainWindow::pollMouse, this, [] {
sdl_mouse_poll();
});