Results 1 to 2 of 2

Thread: About Editing QtreeWidget

  1. #1
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Wink About Editing QtreeWidget

    Hi,

    My QtreeWidgetItem contains 3 columns, is it possible to Edit the QTreeWidgetItem columnwise like, editing only certain columns of a QTreeWidgetItem but not as a whole Item.


    Qt Code:
    1. void classGUI::on_treeWidget_itemDoubleClicked(QTreeWidgetItem* itm,int col)
    2. {
    3. if(col == 0)
    4. {
    5. //if(itm)
    6. //{
    7. itm->setFlags(itm->flags());
    8. //}
    9. }
    10. else
    11. {
    12. itm->setFlags(itm->flags() | Qt::ItemIsEditable);
    13. // this ll make us edit Respective QTreeWidgetItem(all the columns it has)
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 

    but , it should not be editable when i double click first column of the QTreeWidgetItem.
    Last edited by nikhilqt; 22nd January 2008 at 13:51.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: About Editing QtreeWidget

    J-P Nurmi

Similar Threads

  1. Having trouble clearing a QTreeWidget.
    By Nyphel in forum Qt Programming
    Replies: 28
    Last Post: 10th October 2007, 15:33
  2. how to add icons to QTreeWidget?
    By wei243 in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2007, 08:34
  3. QTreeWidget item editing: want column specificity
    By McKee in forum Qt Programming
    Replies: 12
    Last Post: 10th December 2006, 22:12
  4. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  5. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32

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.