My application doesn't block at startup if I give up using the method show.
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
WindowFrame::SFMLFrame = std::make_shared<QFrame>();
WindowFrame::SFMLFrame->setWindowTitle("Qt SFML");
WindowFrame::SFMLFrame->resize(GS::resWidth, GS::resHeight);
WindowFrame::SFMLFrame->show();
WindowFrame::SFMLWindow = std::make_shared<MyCanvas>(WindowFrame::SFMLFrame.get(), QPoint(0, 0), QSize(GS::resWidth, GS::resHeight));
WindowFrame::SFMLWindow->show(); // blocks here
return app.exec();
}
The following code doesn't block at all:
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
WindowFrame::SFMLFrame = std::make_shared<QFrame>();
WindowFrame::SFMLFrame->setWindowTitle("Qt SFML");
WindowFrame::SFMLFrame->resize(GS::resWidth, GS::resHeight);
WindowFrame::SFMLFrame->show();
WindowFrame::SFMLWindow = std::make_shared<MyCanvas>(WindowFrame::SFMLFrame.get(), QPoint(0, 0), QSize(GS::resWidth, GS::resHeight));
//WindowFrame::SFMLWindow->show();
return app.exec();
}
(... but the window is kept blank indefinitely.)
The following code doesn't block at all as well, but no window shows up:
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
WindowFrame::SFMLFrame = std::make_shared<QFrame>();
WindowFrame::SFMLFrame->setWindowTitle("Qt SFML");
WindowFrame::SFMLFrame->resize(GS::resWidth, GS::resHeight);
//WindowFrame::SFMLFrame->show();
WindowFrame::SFMLWindow = std::make_shared<MyCanvas>(WindowFrame::SFMLFrame.get(), QPoint(0, 0), QSize(GS::resWidth, GS::resHeight));
WindowFrame::SFMLWindow->show();
return app.exec();
}
Now, in either of these last two codes, if I later try to show the other widget (that is, WindowFrame::SFMLFrame for the third code, and WindowFrame::SFMLWindow for the second code) by pressing a QPushButton that is connected to a function that calls the show method, the program blocks just like it does in the first code.