Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Testing the mouse cursor shape
QtWS25 Last Chance

Testing the mouse cursor shape

Scheduled Pinned Locked Moved General and Desktop
testguiqt test
2 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Victor P.
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      reading from docs QWidget::cursor() should do the job. Have you tried it?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved