Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

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

    General and Desktop
    2
    2
    348
    Loading More Posts
    • 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
      Qt Enthusiast last edited by

      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 Reply Quote 0
      • V
        v0l0dia last edited by

        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 Reply Quote 1
        • First post
          Last post