- attempt to fix the problem with non-working setTooltip()

This commit is contained in:
Dmytro Bogovych 2023-05-13 20:32:45 +03:00
parent 9ff378d5e0
commit 37840dfdb1

View File

@ -299,6 +299,7 @@ static void dispatchToMainThread(std::function<void()> callback)
QTimer* timer = new QTimer(); QTimer* timer = new QTimer();
timer->moveToThread(qApp->thread()); timer->moveToThread(qApp->thread());
timer->setSingleShot(true); timer->setSingleShot(true);
timer->setInterval(std::chrono::milliseconds(500));
QObject::connect(timer, &QTimer::timeout, [=]() QObject::connect(timer, &QTimer::timeout, [=]()
{ {
// main thread // main thread
@ -345,7 +346,6 @@ void MainWindow::shiftTo(AppState newState)
dispatchToMainThread([this](){ dispatchToMainThread([this](){
onUpdateUI(); onUpdateUI();
}); });
} }
void MainWindow::onUpdateUI() void MainWindow::onUpdateUI()