[Qt-creator] Find/replace keys

Eike Ziller Eike.Ziller at qt.io
Mon Feb 11 09:40:21 CET 2019



> On 8. Feb 2019, at 16:15, Jason H <jhihn at gmx.com> wrote:
> 
> 
> 
>> Sent: Friday, February 08, 2019 at 4:30 AM
>> From: "Eike Ziller" <Eike.Ziller at qt.io>
>> To: "Jason H" <jhihn at gmx.com>
>> Cc: qt-creator <qt-creator at qt-project.org>
>> Subject: Re: [Qt-creator] Find/replace keys
>>> On 7. Feb 2019, at 21:55, Jason H <jhihn at gmx.com> wrote:
>>> 
>>> OSX, Qtc 4.8.1, Dell Keyboard 
>>> On the docked find/replace panel, I've noticed that if I use home/end on the keyboard it doesn't work, but if I use ctrl-left/right it works as home/end. Meanwhile In the source code editing area home/end keys work as they should.
>> 
>> You probably changed the keyboard shortcuts in Prefs > Environment > Keyboard for the code editor (since that is not macOS’s default behavior, which is instead to go to the start/end of the document).
>> These shortcuts are (so far?) unfortunately not used by any of the “normal” QLineEdit based input fields (i.e. anywhere outside the editors).
>> 
>>> Has anyone else noticed this? What would it take to get home/end to work in those lineedits?
>> 
>> I think these input fields (as well as locator and the “path chooser” input fields that we show in some dialogs + options) are Utils::FancyLineEdits, so at least that provides a common base (that is under control of Qt Creator code).
>> Unfortunately the code for making these use the shortcut settings cannot directly added to this class as it is, since the shortcut code is in Core plugin which Utils cannot access.
>> Otherwise adding the use of the shortcuts to these involves some work: Each of the widgets needs an IContext registered for it, and the shortcuts must be registered for these contexts.
>> 
>> Bottom line: Conceptually possible, but involving some work. I’ve created https://bugreports.qt.io/browse/QTCREATORBUG-21959
>> 
>> From the viewpoint of macOS it would be much nicer if Qt could finally respect StandardKeyBinding.dict ... https://bugreports.qt.io/browse/QTBUG-393
> 
> Many thanks for the much info. 
> 
> I don't think I changed it, as TextEditor GotoLineSart has and arrow to the top left, and GotoLineEnd has an arrow to bottom right.  I believe these are Home/End respectively.

The default setting is that the shortcuts for these actions are empty, which effectively means that they are handled like Qt handles them. And Qt uses Cmd+Left/Right for GotoLineStart/End and Home/End for GotoDocumentStart/End, because that is what macOS/Cocoa does (by default).

> However these are not working in the line edit. When I use my keyboard and record a key sequence, home/end keys are displayed as arrows. The key sequence that actually works in the lineedit is Cmd+left/right which shows up as "Cmd+Left"/Right for key sequence. 
> 
> I will add that to the bug for context.

Thanks for confirming my suspicions then :)

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list