[PyQt] QLineEdit vs. menu keyboard shortcuts

Baz Walter bazwal at ftml.net
Tue Jun 28 19:35:54 BST 2011


On 28/06/11 19:28, Yaşar Arabacı wrote:
>> On 28/06/11 19:17, Hans-Peter Jansen wrote:
>>
>>> On Tuesday 28 June 2011, 19:56:35 Nathan Weston wrote:
>>>
>>>> In the latter mode, the widget is temporarily set as non-editable, so
>>>> its built-in Undo behavior doesn't work at all (but it still eats the
>>>> keyboard event!).
>>>>
>>>
>>> If you're subclassing QLineEdit anyway, what does stop you from
>>> overriding keyPressEvent to catch and accept() any unwanted key
>>> presses?
>>>
>>
>> it sounds like he might want to drag with the mouse and use keyboard
>> shortcuts at the same time - otherwise, why worry about keyboard events?
>>
>> (then again, i might just have completely misunderstood :)
>>
> How about setting focus policy to no focus. You can still use drag event but
> widget will never be focused therefore doesn't interfere with shortcuts.

(re-posting this to the list)


More information about the PyQt mailing list