From bf37fe000c6e1dcc6222405eb3a6c5f87764c163 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 14 Apr 2022 08:26:49 +0200 Subject: [PATCH] using QMetaObject instead of QTimer for delayed calls --- src/controls/QskSubWindowArea.cpp | 4 ++-- src/inputpanel/QskHunspellTextPredictor.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controls/QskSubWindowArea.cpp b/src/controls/QskSubWindowArea.cpp index 66648eb5..90320f81 100644 --- a/src/controls/QskSubWindowArea.cpp +++ b/src/controls/QskSubWindowArea.cpp @@ -126,8 +126,8 @@ void QskSubWindowArea::itemChange( { // the child is not fully constructed // and we have to delay checking for sub windows - QTimer::singleShot( 0, this, - [ this ] { qskUpdateEventFilter( this ); } ); + QMetaObject::invokeMethod( this, + [ this ] { qskUpdateEventFilter( this ); }, Qt::QueuedConnection ); break; } diff --git a/src/inputpanel/QskHunspellTextPredictor.cpp b/src/inputpanel/QskHunspellTextPredictor.cpp index 77099176..0136380c 100644 --- a/src/inputpanel/QskHunspellTextPredictor.cpp +++ b/src/inputpanel/QskHunspellTextPredictor.cpp @@ -103,7 +103,8 @@ QskHunspellTextPredictor::QskHunspellTextPredictor( m_data->locale = locale; // make sure we call virtual functions: - QTimer::singleShot( 0, this, &QskHunspellTextPredictor::loadDictionaries ); + QMetaObject::invokeMethod( this, + &QskHunspellTextPredictor::loadDictionaries, Qt::QueuedConnection ); } QskHunspellTextPredictor::~QskHunspellTextPredictor()