Update DockAreaTabBar.cpp

Sometimes the synchronous calculation of the rectangular area fails
This commit is contained in:
Eric Wong 2023-06-08 09:13:41 +08:00 committed by GitHub
parent 0bfee09b17
commit 1049576349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,7 @@
#include <QBoxLayout>
#include <QApplication>
#include <QtGlobal>
#include <QTimer>
#include "FloatingDockContainer.h"
#include "DockAreaWidget.h"
@ -107,7 +108,9 @@ void DockAreaTabBarPrivate::updateTabs()
{
TabWidget->show();
TabWidget->setActiveTab(true);
_this->ensureWidgetVisible(TabWidget);
QTimer::singleShot(0, [&, TabWidget]{
_this->ensureWidgetVisible(TabWidget);
});
}
else
{