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
Forum Updated to NodeBB v4.3 + New Features

Testing the mouse cursor shape

Scheduled Pinned Locked Moved General and Desktop
testguiqt test
2 Posts 2 Posters 1.2k Views 2 Watching
  • 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 30 Mar 2015, 15:48 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 30 Mar 2015, 16:28 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

      1/2

      30 Mar 2015, 15:48

      • Login

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