Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. In QtreeView , there is Model View Architecture there is data , there is model and there View
QtWS25 Last Chance

In QtreeView , there is Model View Architecture there is data , there is model and there View

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 407 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by
    #1

    In QtreeView , there is Model View Architecture there is data , there is model and there View

    QtreeView is the view

    QAbstractItemModel is the model

    what is data in it . Also if I I have implimenet my own custome model Can anyone let me know exact basic steps to start for custom model

    1 Reply Last reply
    0
    • V Offline
      V Offline
      v0l0dia
      wrote on last edited by
      #2

      There's a general tutorial http://doc.qt.io/qt-5/qtwidgets-itemviews-simpletreemodel-example.html

      In general case you should have at least some class/struct for tree nodes, that will contain per-node data and possible children nodes. Then you just reimplement all needed abstract model functions, and for tree model it's basically required to reimplement parent() and index() funcitons to track parent-to-children relations inside model.

      1 Reply Last reply
      1

      • Login

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