diff --git a/tests/tst_docks.cpp b/tests/tst_docks.cpp index 661f55c2..0aedef1a 100644 --- a/tests/tst_docks.cpp +++ b/tests/tst_docks.cpp @@ -5866,7 +5866,12 @@ void TestDocks::tst_titleBarFocusedWhenTabsChange() auto frame2 = qobject_cast(dock2->frame()); TabWidget *tb = frame2->tabWidget(); QCOMPARE(tb->currentIndex(), 1); // Was the last to be added - tb->setCurrentDockWidget(0); + + auto tabBar = dynamic_cast(tb->tabBar()); + const QRect rect0 = tabBar->tabRect(0); + const QPoint globalPos = tabBar->mapToGlobal(rect0.topLeft()) + QPoint(5, 5); + Tests::clickOn(globalPos, tabBar); + QVERIFY(!dock1->titleBar()->isFocused()); QVERIFY(dock2->titleBar()->isFocused()); }