Results 1 to 5 of 5

Thread: I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMoving

  1. #1
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMoving

    Hi, everyone
    I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMoving.
    mouseClick has not effect...

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMov

    Hi,

    Did you reimplement the mouse move, press and release event in your widget class?

  3. #3
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMov

    Hi, thanks first.
    I don't reimplement the mouse events, and I don't know how.
    Now I know Qt does process mouseClick, but maybe it just sends the event to the specified widget instead of really clicking at the position given.
    Now I'm confused about how to make it click....thanks again.

  4. #4
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMov

    To give a statement in detail, I use QTestEventList to addMouseMove, addMouseClick and addKeyClick(Qt::Key_Tab).
    When run the program, mouse moved and focus passed to the next unit, but I really can not find mouseClick...

  5. #5
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMov

    Hi, code below
    eventList.addDelay(2000);
    eventList.addMouseMove(pos);
    eventList.addDelay(2000);
    eventList.addMouseClick(Qt::LeftButton);
    eventList.addDelay(2000);
    eventList.addKeyClick(Qt::Key_Tab);
    eventList.addDelay(2000);
    eventList.addMouseClick(Qt::LeftButton);
    eventList.addDelay(2000);
    eventList.addKeyClick(Qt::Key_Tab);
    eventList.addDelay(2000);
    eventList.addMouseClick(Qt::RightButton);
    eventList.addDelay(2000);
    eventList.addKeyClick(Qt::Key_Tab);
    eventList.addDelay(2000);
    eventList.addKeyClick(Qt::Key_A);
    eventList.addDelay(2000);
    eventList.addKeyClick(Qt::Key_0);
    eventList.simulate(this);

Similar Threads

  1. QGraphicsView Mouse Events
    By tomf in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2008, 15:03
  2. Mouse Events
    By daviddoria in forum Qt Programming
    Replies: 6
    Last Post: 13th May 2008, 11:55
  3. mouse events
    By xyzt in forum Newbie
    Replies: 3
    Last Post: 23rd March 2008, 11:14
  4. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13
  5. QPushButton mouse events
    By Twey in forum Newbie
    Replies: 5
    Last Post: 15th January 2006, 16:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.