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. How to generate a fake mouse events?
Forum Updated to NodeBB v4.3 + New Features

How to generate a fake mouse events?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.8k Views 1 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.
  • E Offline
    E Offline
    emmynet
    wrote on last edited by
    #1

    Hi,
    i'm trying to generate a artificial (random pos) mouse events, using:
    QMouseEvent and QCoreApplication::instance()->postEvent()
    without success.
    "Any ideas?" :(

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      you can use QTest::mouseMove(), ::mouseClick() etc.

      More info:

      • "QTest":http://developer.qt.nokia.com/doc/qt-4.7/qtest.html#id-bb25a0c4-7bca-451e-bc26-b0d46c6b6243
      • "QTestLib":http://developer.qt.nokia.com/doc/qt-4.7/qtestlib-manual.html#id-5c55b407-8319-459d-b5e8-e88c11cb0897
      • "and a convenient tutorial":http://developer.qt.nokia.com/doc/qt-4.7/qtestlib-tutorial1.html

      Hope that helps.

      (Z(:^

      1 Reply Last reply
      0
      • E Offline
        E Offline
        emmynet
        wrote on last edited by
        #3

        Tnks,
        I'll try it!!!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          But QtTest is to be used for test automation, not for productive code. IMHO you should not deploy it. From my POV, you should use platform specific code to do it or check, how QtTest does it and do it in the same way.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          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