×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Question Opening QML application takes a lot of time

    Hi,

    I have a little problem in my QML application.
    When opening my application on Symbian^3 devices, it takes a lot of time to open.(I've tested it on E7 and it takes 7 sec, and on N8 it takes about 15 sec.)
    Is there a way to solve this issue ? Note that I'm using 20 signals between the main.qml and the MainWindow.cpp (i think that this is the problem)

    So how can I optimize it ? Any idea ?

    Thanks in advance.
    Lipos123

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Opening QML application takes a lot of time

    Check this. I just have heard abt this.

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: Opening QML application takes a lot of time

    Quote Originally Posted by kkrish View Post
    Check this. I just have heard abt this.
    It's a nice thing to learn.
    But It didn't work on my Symbian project. I think it's only for Harmattan. (I have insert all the .pro things, but I'm still not able to include <MDeclarativeCache> in my main.cpp)

  4. #4
    Registered User
    Join Date
    Jul 2004
    Posts
    166

    Re: Opening QML application takes a lot of time

    Yes, Booster solution is for Harmattan platform only. I am also curious how to make Qt app launch faster on other platform.
    http://kunalmaemo.blogspot.com/

  5. #5
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: Opening QML application takes a lot of time

    Quote Originally Posted by kunal_the_one View Post
    Yes, Booster solution is for Harmattan platform only. I am also curious how to make Qt app launch faster on other platform.
    If you find anything related to this subject, kindly share it with me, because It's a big problem that the application takes around 10 sec. to open.

    Thanks in advance,
    Lipos123

  6. #6
    Registered User
    Join Date
    May 2009
    Location
    Greece
    Posts
    191

    Re: Opening QML application takes a lot of time

    Would it help using the QML Loader component? http://doc.qt.nokia.com/latest/qml-loader.html

    The Loader component would really boost the time to open in case your application has many views. If you have multiple views, even if they are not visible from the beginning they are constructed when the application opens. That construction you can postpone which will result less opening time.

  7. #7
    Registered User
    Join Date
    Dec 2010
    Posts
    41

    Re: Opening QML application takes a lot of time

    Yeah, the Loader component should seals the deal

  8. #8
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: Opening QML application takes a lot of time

    Still didn't found any solution for this problem.
    I have 17 .qml files, when I remove some of them (like 12 qml files per example), 5 qml files remains in my project and the application open in 1 or 2 seconds.
    But when I implement all the 17 .qml files, it takes alot of time.......

    Is there any solution ?

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Opening QML application takes a lot of time

    Have you tried to use QML Loader to load your QML files (as suggested by other people here)?

    Remember that when you fill loader.source property, the Loader loads the component.
    When loader.source contains an empty string the component is destroyed.
    You should create the pages only when you need them

    Do you really need to load all pages when the app starts up?

  10. #10
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: Opening QML application takes a lot of time

    Quote Originally Posted by gnuton View Post
    Have you tried to use QML Loader to load your QML files (as suggested by other people here)?

    Remember that when you fill loader.source property, the Loader loads the component.
    When loader.source contains an empty string the component is destroyed.
    You should create the pages only when you need them

    Do you really need to load all pages when the app starts up?

    No I don't need to load all the pages. All I need to load at the startup of the application is the main.qml.
    Maybe I am doing something wrong.
    Kindly look a little bit to my below code, maybe I am loading all the pages at the stratup of the app.

    //main.cpp
    #include <QtGui/QApplication>
    #include "qmlapplicationviewer.h"
    #include <QtDeclarative>
    #include<mainwindow.h>
    #include<QDeclarativeView>
    #include<QUrl>
    #include<QHash>
    #include "treemodel.h"
    int main(int argc, char *argv[])
    {
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    qmlRegisterType<MainWindow>("MainWindow",1,0,"MainWindow");
    qmlRegisterType<TreeModel>("TreeModel",1,0,"TreeModel");
    QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
    viewer->setMainQmlFile(QLatin1String("qml/myappqml/main.qml"));
    viewer->showExpanded();
    return app->exec();
    }

    //main.qml
    import QtQuick 1.1
    import com.nokia.symbian 1.1
    import MainWindow 1.0
    import Qt.labs.folderlistmodel 1.0

    PageStackWindow {



    id: appWindow
    initialPage: mainPage
    showStatusBar: true
    showToolBar: true

    RegistrationPage{
    id:regPage
    }

    MainPage {
    id: mainPage
    ListModel {
    id: feedModelContact
    }
    }


    ListModel {
    id: listModelBroadcast
    }

    ListModel {
    id: feedModelll
    }

    ListModel {
    id: Model1
    }
    ListModel {
    id: Model2
    }
    ListModel {
    id: Model3
    }
    ListModel {
    id: Model4
    }
    ListModel {
    id: Model5
    }

    ListModel {
    id: updatesmodel
    }

    ListModel {
    id: feedModela
    }

    ListModel {
    id: feedModel
    }

    ListofMusicPage{
    id: listmusicpage
    }

    ListModel{
    id: imagemodel
    }


    ListModel {
    id: messageModel
    }

    MainWindow{
    id: mainwndw

    onmyfunc:{
    ......
    }
    on.........
    }
    }

  11. #11
    Registered User
    Join Date
    May 2009
    Location
    Rome
    Posts
    268

    Re: Opening QML application takes a lot of time

    First get an extimate on how long is an empty qmL app startup time ... that is the minimum time you can expect on a specific device
    then try to identify bottlenecks by selectively disabling code ... or even better profile code ... http://labs.qt.nokia.com/2011/04/07/...mance-monitor/
    After that you can acts on the right piece of code to speed up app booting
    Keep it simple, stupid
    borg - http://store.ovi.com/content/116105

  12. #12
    Registered User
    Join Date
    Feb 2010
    Posts
    210

    Re: Opening QML application takes a lot of time

    I have had the same problem, very slow loading, I use the loader to load the qml's but there is alot going on in my main.qml so it takes 3~5 seconds to load on my X7 and 5~10 seconds to load on my android2.2.
    I found QSplashscreen works well to display a loading screen. I call it from main.cpp, it works great and the user now has something to look at while the qml loads.
    I also found that the SQLlite storage for qml was a significant bottleneck for loading and unloading qml files with alot of stored data. I found using QSettings made the loading and storing of the data instantaneous!
    Lukas Geyer posted a great wrapper for using qsettings with qml, see here:
    http://developer.qt.nokia.com/forums/viewthread/11696/.
    Cheers,
    Jon

  13. #13
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Opening QML application takes a lot of time

    Hi,
    Usage of QWidgets as QSplashScreen in QML apps is not really a good choice. You can achieve the same using something like this:

    Item {
    id: rootItem

    Rectangle {
    id: qmlSplashScreen
    anchors.fill: parent

    }

    Loader {
    id: myRealAppLoader
    }

    Component.onCompleted: myRealAppLoader.source = "myapp.qml"
    }

  14. #14
    Registered User
    Join Date
    Feb 2010
    Posts
    210

    Re: Opening QML application takes a lot of time

    Thanks for the feed back gnuton!
    Can you elaborate why using QSplashscreen is not a good idea?
    I have not tried your solution but I think that it would load significantly slower than the widget splash screen since it's qml based, granted its just a simple qml but qml seems to be the bottle neck in general. QtQuick has been anything but "quick" at run time in my experience.
    Its not so bad on my nokia but the slow performance is a real problem on my slow android device.
    Cheers,
    Jon

  15. #15
    Registered User
    Join Date
    Apr 2009
    Posts
    506

    Re: Opening QML application takes a lot of time

    Quote Originally Posted by Jon Heron View Post
    QtQuick has been anything but "quick" at run time in my experience.
    I think quick meant developing time instead of runtime
    Symbian & Qt developer. http://vladest.org

Page 1 of 2 12 LastLast

Similar Threads

  1. QA takes too much time and support keeps silence
    By nETPOBu4 in forum [Closed] Publishing to Nokia Store
    Replies: 6
    Last Post: 2011-02-09, 10:54
  2. Replies: 1
    Last Post: 2009-09-08, 17:25
  3. GPS Latching takes lot of time.
    By pranay_preet in forum Symbian C++
    Replies: 8
    Last Post: 2009-02-03, 07:40
  4. Reading file takes more time on Nokia E61i while less time on Nokia 2626
    By arpit2agrawal in forum Mobile Java General
    Replies: 5
    Last Post: 2008-10-15, 14:57
  5. Page takes a lot of time to appear
    By SymVian in forum Symbian C++
    Replies: 2
    Last Post: 2006-01-16, 07:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •