PDA

View Full Version : Perform an automatic click on a webpage



manuelito2459
25th December 2011, 21:50
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:




#include <QApplication>
#include <QWebView>
#include <QCursor>


int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QWebView *pageWeb = new QWebView;
pageWeb->load(QUrl("http://www.google.com/"));

QCursor::setPos(220,130);

void QTest::mousePress ( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(220,30), int delay = -1 )

return app.exec();
}





Do you know how can I complete this code please?

Thanks for your help!