Results 1 to 7 of 7

Thread: Modify model data in QTreeView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Modify model data in QTreeView

    Quote Originally Posted by YuriyRusinov View Post
    Hello !

    I subclassed QItemDelegate, QAbstractItemModel in order to build tree model and see data in QTreeView. Now I need to modify model data, do I have to subclass QTreeView or I can achive it using QTreeView ?

    I tested to subclass the item :-( is not easy!
    I found a way to make a xml file tree unlimited .... and on a simple class i manage
    the domelement & QTreeWidgetItem & the level of tree....

    each new Item i add on aa QList<OneTree*> niagaratree; xxx.additem(**) an so i can interact on 2 class... on add item remove rename ecc... on QDomElement you can save all data image html page e other ..on.. QDomElement like a oracle DB :-)....

    to delete on item i save the Nr of tree ... and fast save the file xml + reload the GUI whitout the delete nr..item ...

    Is moore simple way... and fast....


    Qt Code:
    1. QList<OneTree*> niagaratree;
    2. typedef QMap<QString, QString> Treevar;
    3.  
    4. class OneTree : public QObject, public Base_Function
    5. {
    6. Q_OBJECT
    7.  
    8. public:
    9. OneTree( QDomElement d , QTreeWidgetItem * top , int lev );
    10. ...............
    11. private:
    12. .....
    13. signals:
    14. void SendtonewDom(int);
    15. void SendtoParent(QString);
    16. public slots:
    17. void MoveToNewDest()
    18. {
    19. /////qDebug() << "### ONLISTER emit start " << ONLISTER;
    20. emit SendtonewDom(ONLISTER);
    21. }
    22.  
    23. };
    To copy to clipboard, switch view to plain text mode 
    Last edited by patrik08; 26th October 2006 at 12:51.

Similar Threads

  1. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 20:17
  2. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53
  3. Model, view, resize to show all data
    By jcr in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2006, 20:59
  4. how to use QTreeView with Database model
    By mikro in forum Newbie
    Replies: 3
    Last Post: 13th April 2006, 16:12
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.