Creation of QApplication takes a LONG time
-
I'm developing a QML app on an embedded device. Currently it takes a long time for our application to start (show a working user-interface).
By debugging the application I have noticed the creation of QApplication object takes a long time (about 40 seconds) on our device. I have also run our application using strace and I noticed that Qt is looking for files a lot:
@
read(28, "VolumeWindow\tVolumeWindow.qml\nAu"..., 16384) = 293
read(28, "", 16091) = 0
close(28) = 0
stat64("/i686-linux/QtQuick.1.0/qmldir", 0x8c6e13c) = -1 ENOENT (No such file or directory)
lstat64("/i686-linux/QtQuick.1.0/qmldir", 0xbf83f4c0) = -1 ENOENT (No such file or directory)
stat64("/work/sotas_m3/top/CI/.jenkins/workspace/Qt/host/opt/thales/usr/imports/QtQuick.1.0/qmldir", 0x8cd160c) = -1 ENOENT (No such file or directory)
lstat64("/QtQuick.1.0/qmldir", 0xbf83f4c0) = -1 ENOENT (No such file or directory)
stat64("/i686-linux/QtQuick.1/qmldir", 0x8c6e13c) = -1 ENOENT (No such file or directory)
lstat64("/i686-linux/QtQuick.1/qmldir", 0xbf83f4c0) = -1 ENOENT (No such file or directory)
@Is there are way to improve this? (Maybe generate a file location map so the application doesn't continously search for files? Or any other suggestions?
-
You tryed with QCoreApplication?
-
I have an user interface application, so I have to use QApplication instead of QCoreApplication:
@
Detailed DescriptionThe QCoreApplication class provides an event loop for console Qt applications.This class is used by non-GUI applications to provide their event loop. For non-GUI application that uses Qt, there should be exactly one QCoreApplication object. For GUI applications, see QApplication.@
-
That works fine for me on Symbian devices, and took less time to launch:
@
Q_DECL_EXPORT int main(int argc, char *argv[])
{
// qInstallMsgHandler(GGG_MessageHandler);
QScopedPointer<QCoreApplication> app(createApplication(argc, argv));....
return app.exec();
}
@ -
Yep, is a symbian belle app