Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Need a tip which model to use
Forum Updated to NodeBB v4.3 + New Features

Need a tip which model to use

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 786 Views 1 Watching
  • 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.
  • K Offline
    K Offline
    Kakadu
    wrote on last edited by
    #1

    I'm studing QML and its models. I want to create app for browsing libraries for OCaml language. This is what I have now

    !http://wstaw.org/m/2012/11/30/plasma-desktopxJ4771.png(now)!

    You see two listviews with items. Let's suppose we have N listviews. After selecting some item in listView M there are two possible behaviors:

    ListViews from M+1 to N are removed. If item has subitems new ListView showing contents of selected item in ListView number M is added to the right.

    ListViews from M+1 to N are removed. If item has no subitems no listViews are created. The field for item's description is changed.

    I have a sort of realization "now":https://github.com/Kakadu/QOcamlBrowser/tree/4a662fd03d38c99731af893edff1a858fe433f58 . "This is QML file":https://github.com/Kakadu/QOcamlBrowser/blob/4a662fd03d38c99731af893edff1a858fe433f58/qml/QOcamlBrowser/main.qml

    My model is number -- count of ListViews. I have C++ object using which I can get items for each ListView. But I have problems with updating: when model changed all listviews are reevaluted and it is not good because I need to set back selected indexes for each ListView. I want some kind of model and view which will not reevaluate all content after selecting something.

    Do you have any ideas how to implemet it? Can I use Lists of QObjects? Or it is better to inherit QAbstractItemModel?

    P.S. "This is Qt manpage about models for fast access":http://doc.qt.digia.com/qt/qdeclarativemodels.html

    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