Results 1 to 5 of 5

Thread: [QListWidget] problem with editTriggers

  1. #1
    Join Date
    Jan 2009
    Posts
    51
    Thanks
    28
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [QListWidget] problem with editTriggers

    I've checked editTriggers->DoubleClicked in designer, but when i click twice on item of my listWidget nothing happens.
    Also clicking F2 doesn't make any result.
    Where's the problem?
    Thanks a lot!

    PS. I'm using Qt Creator candidate release.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QListWidget] problem with editTriggers

    Is your item editable ? If not set it editable .

  3. The following user says thank you to aamer4yu for this useful post:

    Macok (17th February 2009)

  4. #3
    Join Date
    Jan 2009
    Posts
    51
    Thanks
    28
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [QListWidget] problem with editTriggers

    Thanks, I have one more question:
    Is there any way to create listWidget where all items are editable?
    Becouse calling
    Qt Code:
    1. item->setFlags(Qt::ItemIsEditable|Qt::ItemIsSelectable|Qt::ItemIsEnabled|Qt::ItemIsUserCheckable);
    To copy to clipboard, switch view to plain text mode 
    everytime I add anything to the list is boring.

  5. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QListWidget] problem with editTriggers

    I was also looking for it today, but didnt come across it yet.
    You will have to iterate over the items and set their flags.

    But this limits you set flags whenever you add items.
    everytime I add anything to the list is boring.
    I agree
    I used a trick, but not sure if its best thing to do -
    I connected currentChanged signal to a slot, and in this slot I set the flags of the current item .
    It helps in a way that you dont need to be bothered to set flags everytime u add items

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

    Macok (17th February 2009)

  7. #5
    Join Date
    Jan 2009
    Posts
    51
    Thanks
    28
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [QListWidget] problem with editTriggers

    Ok, thanks for help.

Similar Threads

  1. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  2. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  3. Replies: 16
    Last Post: 7th March 2006, 15:57

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.