Results 1 to 15 of 15

Thread: How to make QListWidget items editable?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to make QListWidget items editable?

    try to create a delegate in the heap, i.e. using new operator.
    so, code should like this
    Qt Code:
    1. m_pList->setItemDelegate (new SpinBoxDelegate);
    To copy to clipboard, switch view to plain text mode 

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

    montylee (1st October 2008)

  3. #2
    Join Date
    Oct 2007
    Location
    India
    Posts
    162
    Thanks
    20
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to make QListWidget items editable?

    wow!!! it worked...
    my problem is now resolved.
    thanks a lot to both of you!

    I have one more query:
    I am not sure why the delegate goes out of scope...is it because the List widget variable is not local?

  4. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to make QListWidget items editable?

    because, QListWidget has global scope in a class and the delegate local scope in ctor of the class.
    Last edited by spirit; 1st October 2008 at 12:30. Reason: updated contents

  5. #4
    Join Date
    Oct 2007
    Location
    India
    Posts
    162
    Thanks
    20
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to make QListWidget items editable?

    thanks for the clarification

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.