Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Listmodel and large amount of data
QtWS25 Last Chance

Listmodel and large amount of data

Scheduled Pinned Locked Moved Mobile and Embedded
16 Posts 4 Posters 6.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andre
    wrote on last edited by
    #7

    @huot: those 30 items:

    • Are they structured or indexed or something like that, or is it one huge list?
    • Is your data random accessible or not?
    • Are these items big (kilobytes) or small (a few bytes each)?
    • Are all your items going to be same size, or do they have different sizes?
    • ...

    You are simply not providing enough information.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      huot
      wrote on last edited by
      #8

      Maybe I didn't make myself clear enough.

      I am developing a bible reader application for Nokia N9. As you may know the bible consists of books, chapters and verses. Item of the model is similar to bible verse. The data added to the model one chapter at a time (consist of many verses). If the user picks a verse he should be able to scroll both backwards and forwards.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        huot
        wrote on last edited by
        #9

        Volker and Andre, any suggestions how I should implement this?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #10

          Please, practice a bit of patience. Kicking your issue this fast is not considdered very polite, we both have day jobs and families that demand our attention as well.

          It seems to me your data is very easy to structure. Do you want to have all books, chapters and verses in one big list? Or do you think structuring the data is acceptable?

          1 Reply Last reply
          0
          • H Offline
            H Offline
            huot
            wrote on last edited by
            #11

            I'm sorry if I seemed too impatient. I didn't mean to be rude. I was thinking that all books, chapters and verses would be in one big list so that it is easy for the user to scroll the book back and forth. I don't know if this is a good idea but this is how I have thought it.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              TioRoy
              wrote on last edited by
              #12

              huot,

              I've started to port symbianbible (http://compactbyte.com/symbianbible/) to qt (https://groups.google.com/forum/?fromgroups#!topic/symbianbible/lbSRh8e0r_o).

              The PalmVersion of Bible Reader (Bible++) had same problem: performance.

              Yohanes (the author) keep the original reader code, bacause is optimzed (low memory, low speed).

              I'm starting to port (not recompiliing) the PDB reader and mantain the same structures, because there's a lot PDB bible files in the net. But I'm thinking to migrate the data to SqlLite.

              I'd have pushed the initial source code (initial focus to PDB Reader ) to bitbucket, but I'll migrate to github.

              Can you check the sources?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                TioRoy
                wrote on last edited by
                #13

                I'd forgot the link to the project at BitBucket:

                https://bitbucket.org/raphaelquati/qtbible

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  huot
                  wrote on last edited by
                  #14

                  TioRay:
                  I use Sword project (www.crosswire.org/sword) as backend.

                  Volker:
                  I tried to implement your suggestion of "lazy loading" but I didn't get it working. The problem is that in the data() method the data of the model can't be modified because data() method is CONST.

                  Any suggestions how to solve this problem?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #15

                    Just mark the storage member of your model subclass as mutable. This way you can modify it even in a const method.

                    Doing so is perfectly ok in your case, as the const of data() promises to not change the logical state of your object. In case of lazy loading, you do not change the logical state, but only the physical representation (i.e. the bits and bytes).

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • H Offline
                      H Offline
                      huot
                      wrote on last edited by
                      #16

                      [quote author="Volker" date="1332158256"]Just mark the storage member of your model subclass as mutable. This way you can modify it even in a const method.

                      Doing so is perfectly ok in your case, as the const of data() promises to not change the logical state of your object. In case of lazy loading, you do not change the logical state, but only the physical representation (i.e. the bits and bytes).[/quote]

                      Volker:

                      I tried your suggestion. The problem is that I can't call beginInsertRows() function within data() function because beginInsertRows() function isn't CONST.

                      It seems to be very difficult to implement this with Qt. Any new suggestions are welcome!

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved