Results 1 to 3 of 3

Thread: QTreeview item readonly

  1. #1
    Join Date
    Jul 2010
    Posts
    23
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QTreeview item readonly

    How can I make all items on QTreeView readonly and still be able to be selectable by mouse click? Thanks.
    HYIP Daily Blog - A must read for all HYIP investors. All HYIP news on the net.

  2. The following user says thank you to ken123 for this useful post:


  3. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeview item readonly

    try
    Qt Code:
    1. treeWidget->editTriggers(QAbstractItemView::NoEditTriggers);
    To copy to clipboard, switch view to plain text mode 
    and/or
    Qt Code:
    1. QTreeWidgetItem::setFlags(Qt::ItemIsEditable, false)
    To copy to clipboard, switch view to plain text mode 

  4. The following 2 users say thank you to Spitfire for this useful post:

    ken123 (31st October 2011)

  5. #3
    Join Date
    Jul 2010
    Posts
    23
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTreeview item readonly

    Thanks that did the trick.
    HYIP Daily Blog - A must read for all HYIP investors. All HYIP news on the net.

  6. The following user says thank you to ken123 for this useful post:


Similar Threads

  1. QProgressBar as a QTreeView item
    By T4ng10r in forum Qt Programming
    Replies: 6
    Last Post: 22nd September 2011, 12:37
  2. How to keep selected item in QTreeView
    By TorAn in forum Qt Programming
    Replies: 1
    Last Post: 19th July 2011, 05:16
  3. Extract Item from the QTreeView
    By sajis997 in forum Qt Programming
    Replies: 2
    Last Post: 25th March 2011, 08:40
  4. QTreeView::item stylesheet
    By Baasie in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2009, 14:55
  5. QTreeView and item editing
    By roxton in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2008, 18:56

Tags for this Thread

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.