[Development] QTestlib: how not to test mouseMoveEvent handling

Gatis Paeglis Gatis.Paeglis at qt.io
Tue Jul 9 09:00:47 CEST 2019


> AFAIK Gatis  is working on this (see https://bugreports.qt.io/browse/QTBUG-69414 ). There is a magic define

I have currently postponed that work. The goal is to move all auto tests that rely on mouse to DEFINES += QTEST_QPA_MOUSE_HANDLING. Here is an example of before vs after: https://codereview.qt-project.org/c/qt/qtbase/+/210028 Updating tests in qtbase can be done right now, so any help is welcome. For consistency, Qt Quick tests should utilize the QTEST_QPA_MOUSE_HANDLING code path as well. Cleaning up Qt Quick tests first requires resolving https://bugreports.qt.io/browse/QTBUG-69419 . Some WIP patches for Qt Quick Test lib are in https://bugreports.qt.io/browse/QTBUG-69415 , but it might be wiser to rewrite it in c++ https://bugreports.qt.io/browse/QTBUG-64837

I think it is worth spending time on this, instead of fighting with flaky or hard to read auto tests in future.






________________________________
From: Development <development-bounces at qt-project.org> on behalf of Friedemann Kleint <Friedemann.Kleint at qt.io>
Sent: Tuesday, July 9, 2019 8:33 AM
To: development at qt-project.org
Subject: Re: [Development] QTestlib: how not to test mouseMoveEvent handling

Hi,

AFAIK Gatis  is working this (see
https://bugreports.qt.io/browse/QTBUG-69414 ). There is a magic define

widgets/widgets/qcombobox/qcombobox.pro:4:DEFINES +=
QTEST_QPA_MOUSE_HANDLING
widgets/widgets/qmenu/qmenu.pro:9:    DEFINES += QTEST_QPA_MOUSE_HANDLING

which apparently changes behavior. Alternatively, the overloads of
QTest::mouse*() that take a QWindow * can be used, which should act more
sane. This might require some coordinate mapping, though.

Friedemann

--
Friedemann Kleint
The Qt Company GmbH

_______________________________________________
Development mailing list
Development at qt-project.org
https://lists.qt-project.org/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190709/9991f88e/attachment-0001.html>


More information about the Development mailing list