Results 1 to 1 of 1

Thread: Perform an automatic click on a webpage

  1. #1
    Join Date
    Dec 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Perform an automatic click on a webpage

    Hello everybody,

    I am a beginner in Qt and I would like to build a program able to click automatically on some link on webpages, depending on signals with Qt.

    For example, if I want to click automatically on a part of google.com, i wrote this:

    Qt Code:
    1. #include <QApplication>
    2. #include <QWebView>
    3. #include <QCursor>
    4.  
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QApplication app(argc, argv);
    9.  
    10. QWebView *pageWeb = new QWebView;
    11. pageWeb->load(QUrl("http://www.google.com/"));
    12.  
    13. QCursor::setPos(220,130);
    14.  
    15. void QTest::mousePress ( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(220,30), int delay = -1 )
    16.  
    17. return app.exec();
    18. }
    To copy to clipboard, switch view to plain text mode 

    Do you know how can I complete this code please?

    Thanks for your help!
    Last edited by manuelito2459; 25th December 2011 at 22:00.

Similar Threads

  1. Replies: 8
    Last Post: 17th June 2011, 21:36
  2. Replies: 5
    Last Post: 27th May 2011, 02:51
  3. Replies: 4
    Last Post: 13th January 2011, 07:58
  4. Perform a cyclic task in a QState
    By schall_l in forum Qt Programming
    Replies: 1
    Last Post: 16th April 2010, 23:18
  5. Replies: 12
    Last Post: 22nd March 2010, 08:59

Tags for this Thread

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.