Results 1 to 15 of 15

Thread: How to make QListWidget items editable?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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: How to make QListWidget items editable?

    Quote Originally Posted by montylee View Post
    Here's what i am doing:

    Qt Code:
    1. connect (sampleList, SIGNAL (itemDoubleClicked (QListWidgetItem *)), this, SLOT (test (QListWidgetItem *)));
    2.  
    3. void test (QListWidget *item)
    4. {
    5. sampleList->editItem (item);
    6. }
    To copy to clipboard, switch view to plain text mode 
    This is not needed, you can safely throw this piece of code to trash. See QAbstractItemView::editTriggers.

    While creating the list widget items, i am setting the item flags as:

    Qt Code:
    1. item->setFlags (item->flags () & Qt::ItemIsEditable);
    To copy to clipboard, switch view to plain text mode 
    It should be:
    Qt Code:
    1. item->setFlags (item->flags () | Qt::ItemIsEditable);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  2. The following 3 users say thank you to jpn for this useful post:

    montylee (30th September 2008), TheIndependentAquarius (23rd February 2012), TMan (16th December 2009)

Similar Threads

  1. Replies: 1
    Last Post: 5th September 2008, 23:54
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  3. Get Visible Items from the QListWidget
    By srj in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2006, 20:13
  4. Qt 4.2: QListWidget changes size of its items
    By KingFish in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2006, 11:06
  5. [Qt4]: Adding centered items in QListWidget
    By Jojo in forum Qt Programming
    Replies: 4
    Last Post: 16th March 2006, 20:04

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
  •  
Qt is a trademark of The Qt Company.