There is a main window of type QWidget which calls another window of the same class using the StartFunc() function:
void Anime::StartFunc() { secondW = new Form; secondW->show(); secondW->activateWindow(); qDebug() << "Target reached"; } The task is to call the secondW->activateWindow(); method secondW->activateWindow(); the function stopped, waited for the secondW widget to secondW and only then continued to work (call qDebug() << "Target reached"; ).
My experience suggests that you need to do another method in the secondW object which will spin and not give up until a signal comes to close the window. But it seems to me that this is a crutch method and there is a more correct and adequate solution. Is there such a solution?