mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 15:20:05 +00:00
Ensure widgets are always updated on the main thread
Fixes crashes and widget freezes
This commit is contained in:
parent
194638f759
commit
ac40fd93b7
3 changed files with 48 additions and 35 deletions
|
|
@ -494,12 +494,11 @@ void MainWindow::on_actionOpenNexrad_triggered()
|
|||
map::MapWidget* currentMap = p->activeMap_;
|
||||
|
||||
// Make sure the parent window properly repaints on close
|
||||
connect(
|
||||
dialog,
|
||||
&QFileDialog::finished,
|
||||
this,
|
||||
[this]() { update(); },
|
||||
Qt::QueuedConnection);
|
||||
connect(dialog,
|
||||
&QFileDialog::finished,
|
||||
this,
|
||||
static_cast<void (MainWindow::*)()>(&MainWindow::update),
|
||||
Qt::QueuedConnection);
|
||||
|
||||
connect(
|
||||
dialog,
|
||||
|
|
@ -560,12 +559,11 @@ void MainWindow::on_actionOpenTextEvent_triggered()
|
|||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
// Make sure the parent window properly repaints on close
|
||||
connect(
|
||||
dialog,
|
||||
&QFileDialog::finished,
|
||||
this,
|
||||
[this]() { update(); },
|
||||
Qt::QueuedConnection);
|
||||
connect(dialog,
|
||||
&QFileDialog::finished,
|
||||
this,
|
||||
static_cast<void (MainWindow::*)()>(&MainWindow::update),
|
||||
Qt::QueuedConnection);
|
||||
|
||||
connect(dialog,
|
||||
&QFileDialog::fileSelected,
|
||||
|
|
@ -1003,7 +1001,8 @@ void MainWindowImpl::ConnectAnimationSignals()
|
|||
{
|
||||
for (auto map : maps_)
|
||||
{
|
||||
map->update();
|
||||
QMetaObject::invokeMethod(
|
||||
map, static_cast<void (QWidget::*)()>(&QWidget::update));
|
||||
}
|
||||
});
|
||||
connect(timelineManager_.get(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue