PDA

View Full Version : [QListWidget] problem with editTriggers



Macok
17th February 2009, 18:05
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.

aamer4yu
17th February 2009, 18:16
Is your item editable ? If not set it editable .

Macok
17th February 2009, 18:43
Thanks, I have one more question:
Is there any way to create listWidget where all items are editable?
Becouse calling
item->setFlags(Qt::ItemIsEditable|Qt::ItemIsSelectable|Q t::ItemIsEnabled|Qt::ItemIsUserCheckable);everytim e I add anything to the list is boring.

aamer4yu
17th February 2009, 19:20
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 :D
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 ;)

Macok
17th February 2009, 19:35
Ok, thanks for help.