Results 1 to 5 of 5

Thread: Hidden field in QTreeView

  1. #1
    Join Date
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    63
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Hidden field in QTreeView

    Hello, Everyone !

    I wrote SearchTreeModel as same as examples simpletreemodel and put it to QTreeView, screenshot is in attached file. Just now I have to add integer field, that will not show on form, but will be returned if I choice any workspace from list. What's classes and functions I have to modify and which way I have to choice this field from model ?

    --
    Best regards,
    Sincerely yours,
    Yuriy Rusinov.

  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: Hidden field in QTreeView

    I guess you forgot to post the screenshot.

  3. #3
    Join Date
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    63
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Hidden field in QTreeView

    Quote Originally Posted by wysota
    I guess you forgot to post the screenshot.
    It is in attachment.
    Attached Images Attached Images

  4. #4
    Join Date
    Jun 2006
    Posts
    11
    Thanked 4 Times in 4 Posts

    Default Re: Hidden field in QTreeView

    Hmm, don't know about Qt4 but in Qt3 you could set the text of a column that was not visible and use it as a "tag" or whatever to identify an item. In your case that would be something like this when creating the item:
    Qt Code:
    1. QListViewItem* item = new QListViewItem(parent);
    2. // Add the other fields
    3. item->setText(4, QString::number(yourNumber)); // 4 = the fifth column (not visible)
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to eriwik for this useful post:

    YuriyRusinov (30th June 2006)

  6. #5
    Join Date
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    63
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Hidden field in QTreeView [SOLVED]

    All works fine, thanks a lot.

Similar Threads

  1. QTreeView repaint
    By graeme in forum Qt Programming
    Replies: 17
    Last Post: 13th March 2012, 13:27
  2. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24
  3. QSortFilterProxyModel & QTreeView
    By Bear in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 15:04
  4. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00
  5. How to dispay an icon in the first column of QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2006, 15:51

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.