New in Qt 5.11: quick text selection in QLineEdit
There are many reasons why one would want to contribute to a free software project. This post belongs to the “scratch your own itch” category. Firefox is my main browser and I use reddit a lot. I switch between my favourite subreddits many times per day. Sometimes I also use Qupzilla (nowadays called Falkon) because it has a specific reddit account of mine already logged-in.
Now, Firefox has a feature that Falkon used to lack: quick selection of the trailing part of the URL by slightly moving the mouse down, while selecting the text towards the right.
Actually this is feature of GtkEntry
widgets, rather than Firefox specific. In fact, Firefox on Windows doesn’t have it (probably because it doesn’t use GTK on that platform).
Anyway, I use this quick selection all the time when I want to go from one subreddit to another one, and it was so annoying when I couldn’t do the same in Falkon.
And what do you do when you are annoyed by something in some open source software? You try to fix the annoyance, of course!
Since the URL bar in Falkon is a standard QLineEdit
, I had to implement this feature in upstream Qt. This is how it looks in action:
Of course it works also in the other direction: if you move the mouse up while selecting the text towards the left, the line edit widget will select the whole text up to the beginning (as you can see in the Kate search bar below):
We did not forget RTL users, so if the layout direction is right-to-left, the semantic of the mouse movement is inverted.
This new feature will be part of Qt 5.11. Unfortunately the QML TextField
control won’t get it for free (someone will have to port it there).