I'm simulating keyPresses to an application through Qt's KeyPress function. All the KeyPresses work fine. However when I pass a
QWidget *pWin = QApplication::activeWindow;
QObjectList *pList = pWin->children();
//how do you iterate through the list and find the OK or Cancel button?
You can use the
findChild function with the object name to get a specific children.
You can use too
findChildren to get all children that have the same name and the iterate through the list using
To get a button you can try:
QPushButton* button = pWin->findChild<QPushButton*>("Button name");