×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    19

    Question QML View freeze when receiving a large amount of data

    Hi,

    I want to optimize my application concerning displaying the data coming from the server.
    My application is using QXMPP classes and QML design.
    The problem occurs when receiving a large amount of data from the xmpp server to display it on my QML view(inside a listView); The view freeze till the end of the data received from the xmpp server.
    I think I should user QThread in my cpp class, but I have no idea how to use it in this case.

    Anyone can help me concerning this issue?

    Best Regards.

  2. #2
    Registered User
    Join Date
    Apr 2013
    Posts
    19

    Re: QML View freeze when receiving a large amount of data

    Any idea ?

  3. #3
    Regular Contributor
    Join Date
    Feb 2012
    Posts
    124

    Re: QML View freeze when receiving a large amount of data

    Quote Originally Posted by elippo View Post
    Hi,

    I want to optimize my application concerning displaying the data coming from the server.
    My application is using QXMPP classes and QML design.
    The problem occurs when receiving a large amount of data from the xmpp server to display it on my QML view(inside a listView); The view freeze till the end of the data received from the xmpp server.
    I think I should user QThread in my cpp class, but I have no idea how to use it in this case.

    Anyone can help me concerning this issue?

    Best Regards.
    Sorry I don't know the answer, just a suggestion. Would loading each ListItem element with a "Loader" fix the problem?
    http://idlebox.net/2010/apidocs/qt-e...ml-loader.html
    I believe that the loader will nicely do stuff in the background while freeing up the foreground.

  4. #4
    Registered User
    Join Date
    Apr 2013
    Posts
    19

    Re: QML View freeze when receiving a large amount of data

    Quote Originally Posted by CLTSchwarz View Post
    Sorry I don't know the answer, just a suggestion. Would loading each ListItem element with a "Loader" fix the problem?
    http://idlebox.net/2010/apidocs/qt-e...ml-loader.html
    I believe that the loader will nicely do stuff in the background while freeing up the foreground.
    Maybe it will solve my problem. But I am not able to implement it in my delegate.
    I tried to put a loader and assign the sourceComponent to the item id, it gives me the following error : "TypeError: Result of expression 'page' [null] is not an object."
    I tried to put a loader and assign the sourceComponent to some rectangle/column inside the delegate, it gives me the following error : "Unable to assign QObject* to QDeclarativeComponent*".
    So If you can help me with this issue, coz maybe the loader thing will solve my problem. Note that my delegate consist of the below items.
    //MyDelegate.qml
    Item{
    Rectangle{
    .....
    }

    Rectangle{
    .......
    }

    Column{
    Text {
    .......
    }
    Row{
    Text {
    .......
    }
    Button{
    .......
    }
    ProgressBar{
    }
    Image {
    .......
    }
    Text {
    .......
    }
    }
    }
    Text {
    .......
    }
    MouseArea{
    anchors.fill: parent
    .......
    }
    }
    Best Regards

  5. #5
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,004

    Re: QML View freeze when receiving a large amount of data

    Is user allowed to do any activity while the data is fetched from server & displayed from QML view? If not then you may try displaying a simple progress bar till the data is received. Also, the data receiving part is implemented in C++ already & after fetching data the listbox is updated from c++ to qml, right?

  6. #6
    Registered User
    Join Date
    Apr 2013
    Posts
    19

    Re: QML View freeze when receiving a large amount of data

    Quote Originally Posted by vineet.jain View Post
    Is user allowed to do any activity while the data is fetched from server & displayed from QML view? If not then you may try displaying a simple progress bar till the data is received. Also, the data receiving part is implemented in C++ already & after fetching data the listbox is updated from c++ to qml, right?
    Yeah you're right. But What I have at the start-up of the application is a tabView with 3 listView filled from the database (this works well). But in the same time, I request data from the xmpp and from http servers in order to update the listViews and the database; So while getting these data from the server, my listView freeze and I cannot scroll it until all the data is received.
    Note that I've removed the code that update the database and the listView in order to minimize the debugging of the problem, and the same result occurs; I cannot scroll or switch tab until the data have successfully received(without any process on the database or the listView)

  7. #7
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,004

    Re: QML View freeze when receiving a large amount of data

    But do you think it would be right to let the user scroll the list until the data which is to be loaded in it is received successfully?, can user be able to identify then while scrolling that the new data has been received. Showing a wait/progress bar till the data is received & not allowing user to do any activity until then should be ok i suppose(after all what would user look at or switch to when the app is opened & no data is there in the list views)

  8. #8
    Registered User
    Join Date
    Apr 2013
    Posts
    19

    Re: QML View freeze when receiving a large amount of data

    Quote Originally Posted by vineet.jain View Post
    But do you think it would be right to let the user scroll the list until the data which is to be loaded in it is received successfully?, can user be able to identify then while scrolling that the new data has been received. Showing a wait/progress bar till the data is received & not allowing user to do any activity until then should be ok i suppose(after all what would user look at or switch to when the app is opened & no data is there in the list views)
    I got your point. I am using a busy indicator in every http hit made in order to minimize that problem. But If you look at my first post, it was about receiving data from the xmpp server, and the xmpp server is used for chatting projects. So I don't think that on every chat received I have to lunch a wait/progress bar in order to update the database and the listview.
    Note that on the startup of the application, there is a big probability that a set of chats are received (data) by my application.
    So did you got my point why I can't use BusyIndicator in this case ?

  9. #9
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,004

    Re: QML View freeze when receiving a large amount of data

    Ok, picture is clear now. Have you seen the implementation done here : http://gitorious.org/qt-quick-xmpp/q...p/trees/master, may be it can help design wise, though it does not says about Listview and all.

Similar Threads

  1. retrieving large amount of data from a XML file
    By sunitha.m13 in forum Symbian
    Replies: 14
    Last Post: 2012-02-09, 12:19
  2. Downloading large amount of data
    By swap842 in forum Mobile Java General
    Replies: 7
    Last Post: 2010-05-14, 09:55
  3. Need to hardcode large amount of data using RMS in J2ME
    By divya_v in forum Mobile Java General
    Replies: 4
    Last Post: 2008-11-24, 12:44
  4. large amount of memory
    By Digish in forum Symbian
    Replies: 5
    Last Post: 2008-07-15, 12:37
  5. sending large amount of data over ir
    By kumardeepak in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2003-06-23, 11:08

Posting Permissions

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