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



  • 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



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.