QTest mouseClick error
-
Hi
I am trying to simulate a mouse click
@
MainWindow::MainWindow(QWidget *parent)
: QDeclarativeView(parent)
{
...
QTest::mouseClick(this, Qt::LeftButton, 0, QPoint(20,20), -1);
...
}
@It compiles fine but when I Run, I get the following error:
ASSERT: "QTest::testLogger" in file qtestlog.cpp, line 334
The program has unexpectedly finished.I also tried @QTest::mouseClick(parent, Qt::LeftButton, 0, QPoint(20,20), -1);@
Which produces the following error:
ASSERT: "widget" in file /usr/include/qt4/QtTest/qtestmouse.h, line 74
The program has unexpectedly finished.First child for help : )
thanks -
Here you can see the error line in qtestmouse.h
QTEST_ASSERT(widget);@
namespace QTest
{
enum MouseAction { MousePress, MouseRelease, MouseClick, MouseDClick, MouseMove };static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1) { QTEST_ASSERT(widget); extern int Q_TESTLIB_EXPORT defaultMouseDelay();
....
@and the macro itself
#define QTEST_ASSERT(cond) do {if(!(cond))qt_assert(#cond,FILE,LINE);} while (0)