Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Testing the mouse cursor shape
Victor P. last edited by
Making an automatic test for my widget, I want to check whether the mouse cursor will correctly change its shape when the mouse moves over a particular zone. Typically my test would look like:
MySpecialWidget w; w.show(); QTest::mouseMove(&w, w.centerPointOfTheSpecialZone()); QCursor c = ?; // finding out the current cursor here! Qt::CursorShape expectedShape = ?; // it's not the point here QCOMPARE(c.shape(), expectedShape);
How could I test it?
mcosta last edited by
Hi and welcome to devnet,
reading from docs
QWidget::cursor()should do the job. Have you tried it?