Results 1 to 2 of 2

Thread: QTreeWidget - Making a Column editable.

  1. #1
    Join Date
    Jun 2007
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTreeWidget - Making a Column editable.

    Hi,

    I want to make one cell in each row editable. I mean a only one column should be editable. I am using QTreeWidget. For example if below is code.

    QTreeWidgetItem *cities = new QTreeWidgetItem(treeWidget);
    cities->setText(0, tr("Cities"));
    QTreeWidgetItem *osloItem = new QTreeWidgetItem(cities);
    osloItem->setText(0, tr("Oslo"));
    osloItem->setText(1, tr("Yes"));

    We want to make only Yes part editable. If i set flags of osloItem, it make whole of row i.e. olsoItem i.e. Oslo as well as Yes editable.

    Please put some example or code if some one can. Thanks.

  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: QTreeWidget - Making a Column editable.

    Quote Originally Posted by Preeteesh View Post
    Please put some example or code if some one can.
    Here you go.
    J-P Nurmi

Similar Threads

  1. QTreeWidget item editing: want column specificity
    By McKee in forum Qt Programming
    Replies: 12
    Last Post: 10th December 2006, 22:12
  2. Replies: 1
    Last Post: 21st September 2006, 10:37
  3. Change column width in a QTreeWidget
    By mace in forum Qt Programming
    Replies: 2
    Last Post: 27th May 2006, 12:19
  4. Editable QListView Column ??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 3rd May 2006, 18:55

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.