How to open a window before running app.exec() ?
-
Hello there! Total noob here in c++ programming with Qt
I have an application that before starting needs to unzip a file (using QProcess), and the operation may need some time, and then it should open a QML file that uses the unzipped files.
I'd like to show a message, a loading indicator, something like this, until the unzipping process is ended. I tried something like this:
QPushButton button("loading, please wait"); button.show(): unzip(); butt.hide() const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec();but the button showing is completely blank, and loads its text only after app.exec() is executed, so after the unzip has ended
what can I do to make it show before the unzip process has ended?thank you in advance!
-
Hi,
You are looking for either QProgressDialog or QSplashScreen.
-
Hi,
You are looking for either QProgressDialog or QSplashScreen.