Results 1 to 7 of 7

Thread: Reimplemented QStandardItem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2012
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Reimplemented QStandardItem

    Hello!
    I've got QTreeView and QStandardItemModel. There are items in this model based on QStandardItem:
    Qt Code:
    1. class TComplexItem : public QStandardItem
    2. {
    3. public:
    4.  
    5. const TElement *getElement() const;
    6. void setElementData(const TElement & element);
    7.  
    8. private:
    9. TElement *m_pElement; //string and integer members in class TElement
    10. }
    To copy to clipboard, switch view to plain text mode 
    It's now necessary to add to the window with QTreeView some controls for representation data from m_pElement. So when we walk though the tree we should get the appropriate data for current item in these controls.
    How could I do this? It looks like QDataWidgetMapper. But QDataWidgetMapper itself doesn't fit here.

    Thanks in advance for any ideas.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Reimplemented QStandardItem

    What's wrong with QDataWidgetMapper?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Can't paint in reimplemented QHeaderView
    By Tottish in forum Newbie
    Replies: 5
    Last Post: 21st March 2011, 08:56
  2. Tree without using of QStandardItem
    By NoRulez in forum Qt Programming
    Replies: 1
    Last Post: 12th July 2010, 12:23
  3. setObjectName for QStandardItem
    By abk883 in forum Newbie
    Replies: 1
    Last Post: 20th May 2010, 18:20
  4. Replies: 2
    Last Post: 4th December 2009, 06:15
  5. QGraphicsItem reimplemented mouse events
    By aarelovich in forum Qt Programming
    Replies: 12
    Last Post: 24th July 2009, 12:56

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.