[Qt-interest] using QTest::mousePress with QDesktopWidget

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Thu Apr 16 21:42:50 CEST 2009


Hi Ahmed, 
 
I think QTestLib only works with Qt programs - so you cannot use it to drive
any other applications on the desktop.  To do that on Windows you could try
::PostMessage after getting the target apps window handle, or possibly
install a message hook ::SetWindowsHookEx (see the Win32 programmers
reference in the SDK). 
 
Hope that helps, 
 
Tony.
 

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Ahmed Khaled
Sent: Friday, 17 April 2009 05:16
To: qt-interest at trolltech.com
Subject: [Qt-interest] using QTest::mousePress with QDesktopWidget


hello my name is ahmed khaled iam a biomedical engineer who is interested in
Qt
i wandered to ask about how to access my windows XP SP2 desktop and
exploring it with the mouse as moving clickind double clicking and soon.

i have tried to do this but i failed to apply the presssing clicking and
double clicking actions while i succeeded to move the mouse using the
QTestLib

here is my code:

QDesktopWidget *desk = new QDeskTopWidget;

desk->show();

QTest::mouseMove(desk, QPoint(25, 200));
QTest::mouseDClick(desk,Qt::LeftButton, 0, QPoint(25, 200)); // to open a
given folder at this position of the desktop
//or iused this line QTest::mouseDClick(desk,Qt::LeftButton); // to open a
given folder at this position of the desktop

the problem is that the mouse move while the double click action doesnt work

note: my programming environment is Qt4.4.3 & VS2008 over windows XP(2002)
SP2

i wander that you can answer me as soon as possible and i want to know how i
will now the answer to my question as iam not familiar with Qt request


thanks alot and Best regards
ahmed khaled

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090417/c3bae648/attachment.html 


More information about the Qt-interest-old mailing list