×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    1

    Angry Testing mouseClick on QGraphicsWidget using QTestLib ???

    Hi,
    I would like to write autotest to simulate a mouseClick events on a QGraphicsWidget.

    From QTEST this was the only API i could find:
    void mouseClick ( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay = -1 )


    But this take only a QWidget, is there any API with which I can use on a QGraphicsWidget ?

    Or is there any other means thru which i can achieve the same.. ?


    Thanks
    Vijay

  2. #2
    Registered User
    Join Date
    Dec 2008
    Posts
    2

    Re: Testing mouseClick on QGraphicsWidget using QTestLib ???

    you can try this code:
    class TestClasse: public QObject
    {
    Q_OBJECT
    private slots:
    void testeQGV()
    { QgraphicsWidget widget;
    scene.addItem(&widget);
    ...
    QTest::mouseClick(view.viewport(), Qt::LeftButtom, 0,
    widget.geometry().center().mapToScene());
    }
    };

Similar Threads

  1. Replies: 7
    Last Post: 2011-02-12, 18:31
  2. Voice quality testing and measurement tool - evaluation inquiry
    By sevana in forum News and Announcements
    Replies: 0
    Last Post: 2009-05-11, 21:53
  3. Replies: 3
    Last Post: 2009-05-02, 04:32
  4. Replies: 0
    Last Post: 2005-02-17, 19:01
  5. Replies: 0
    Last Post: 2003-10-08, 10:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×