PDA

View Full Version : Simulated ShiftModifier



Micawber
17th June 2008, 16:19
I there a convenient way to set/unset the ShiftModifier such that the modifiers() method of QKeyEvent will return something set programmatically instead of what the keyboard says?

I am using a touch screen as the only interface to my application and I wish to use drag and drop to "move" a file rather than copy it. The only way I can see to do that is to press the shift key when dropping stuff. Since I don't have a keyboard, I'm looking for a way to simulate that by using a move/copy radio button to set the shift modifier.

Any clues would be appreciated.

-Mic

jpn
17th June 2008, 17:30
I'm assuming you're using model view. Have you tried QAbstractItemModel::setSupportedDragActions(Qt::Mo veAction)?

Micawber
17th June 2008, 20:22
I'm assuming you're using model view. Have you tried QAbstractItemModel::setSupportedDragActions(Qt::Mo veAction)?

Um...no? :o

I am amazed at how long I have stared at that documentation and never saw that method! Thank you jpn! I've implemented it now and it is working like I need it to. Wooo Hoooo! :D

-Mic