Hi,
i'm getting the following error message while compiling:
error C2664: 'QTest::mouseClick' : cannot convert parameter 1 from 'QAction *' to 'QWidget *'
error C2664: 'QTest::mouseClick' : cannot convert parameter 1 from 'QAction *' to 'QWidget *'
To copy to clipboard, switch view to plain text mode
This is my coding:
QMenuBar* mb
= pWidget
->findChild<QMenuBar
*>
("menubar");
QAction* fileAction
= mb
->findChild<QAction
*>
("File");
QAction* newProject
= fileAction
->findChild<QAction
*>
("Create New Project...");
QTest::mouseClick( newProject, Qt::LeftButton );
QMenuBar* mb = pWidget->findChild<QMenuBar *>("menubar");
QAction* fileAction = mb->findChild<QAction *>("File");
QAction* newProject = fileAction->findChild<QAction *>("Create New Project...");
QTest::mouseClick( newProject, Qt::LeftButton );
To copy to clipboard, switch view to plain text mode
Two questions:
1) I know that mouseClick expects a QWidget, but in the tutorial the use e.g. QLineEdit so i think this should work with QAction, too?!
2) Is there another possibility to get the children of an object? I think it's weird to get the children from a top-object this way..
kind regards
Bookmarks