Replace 0 msec singleshot with invoke method

This commit is contained in:
Jonas Kvinge
2023-05-03 19:55:58 +02:00
parent 1208ca3ad4
commit 301e6b194a
4 changed files with 9 additions and 9 deletions

View File

@@ -21,7 +21,6 @@
#include "config.h"
#include <QWidget>
#include <QTimer>
#include <QIODevice>
#include <QFile>
#include <QMessageBox>
@@ -30,6 +29,7 @@
#include <QPainter>
#include <QPalette>
#include <QDateTime>
#include <QMetaObject>
#include <QPropertyAnimation>
#include <QKeyEvent>
#include <QEnterEvent>
@@ -292,7 +292,7 @@ void SmartPlaylistSearchTermWidget::resizeEvent(QResizeEvent *e) {
QWidget::resizeEvent(e);
if (overlay_ && overlay_->isVisible()) {
QTimer::singleShot(0, this, &SmartPlaylistSearchTermWidget::Grab);
QMetaObject::invokeMethod(this, &SmartPlaylistSearchTermWidget::Grab);
}
}
@@ -301,7 +301,7 @@ void SmartPlaylistSearchTermWidget::showEvent(QShowEvent *e) {
QWidget::showEvent(e);
if (overlay_) {
QTimer::singleShot(0, this, &SmartPlaylistSearchTermWidget::Grab);
QMetaObject::invokeMethod(this, &SmartPlaylistSearchTermWidget::Grab);
}
}