From 8da0713bf0d964f0c5b62e87a8aa61bcae3fa212 Mon Sep 17 00:00:00 2001 From: UnlimitedStack Date: Sat, 16 Mar 2024 01:23:42 +0100 Subject: [PATCH] Ensure that TabWidget was not deleted by using it as context object (#612) Co-authored-by: Marcus Venturi --- src/DockAreaTabBar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DockAreaTabBar.cpp b/src/DockAreaTabBar.cpp index e461d04..437fe6d 100644 --- a/src/DockAreaTabBar.cpp +++ b/src/DockAreaTabBar.cpp @@ -111,8 +111,9 @@ void DockAreaTabBarPrivate::updateTabs() // Sometimes the synchronous calculation of the rectangular area fails // Therefore we use QTimer::singleShot here to execute the call // within the event loop - see #520 - QTimer::singleShot(0, [&, TabWidget]{ - _this->ensureWidgetVisible(TabWidget); + QTimer::singleShot(0, TabWidget, [&, TabWidget] + { + _this->ensureWidgetVisible(TabWidget); }); } else