forked from qt-creator/qt-creator
QmlProfiler: Run flamegraph view context menu test on a timer
Apparently the popup window is not automatically activated. Change-Id: I12e952568630d5ffe5d5dab9012b617a28ef9285 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
@@ -116,12 +116,16 @@ void FlameGraphViewTest::testContextMenu()
|
||||
targetHeight = (testMenu.height() + prevHeight) / 2;
|
||||
}
|
||||
|
||||
connect(view.windowHandle(), &QWindow::activeChanged, this, [&]() {
|
||||
if (view.windowHandle()->isActive())
|
||||
QTimer timer;
|
||||
timer.setInterval(50);
|
||||
timer.start();
|
||||
|
||||
connect(&timer, &QTimer::timeout, this, [&]() {
|
||||
auto activePopup = qApp->activePopupWidget();
|
||||
if (!activePopup || !activePopup->windowHandle()->isExposed())
|
||||
return;
|
||||
QTest::qWaitForWindowExposed(qApp->activePopupWidget());
|
||||
QTest::mouseMove(qApp->activePopupWidget(), QPoint(targetWidth, targetHeight));
|
||||
QTest::mouseClick(qApp->activePopupWidget(), Qt::LeftButton, Qt::NoModifier,
|
||||
QTest::mouseMove(activePopup, QPoint(targetWidth, targetHeight));
|
||||
QTest::mouseClick(activePopup, Qt::LeftButton, Qt::NoModifier,
|
||||
QPoint(targetWidth, targetHeight));
|
||||
|
||||
if (!manager.isRestrictedToRange()) {
|
||||
|
||||
Reference in New Issue
Block a user