While the S60 port was going on, it became clear to us that there was something that Qt needed: A proper API for dealing with input panels (also called virtual keyboards). For the S60 platform the motivation was obvious, since most touch phones use some sort of on-screen keyboard. But we also wanted to make the API in such a way that it could be used by developers on other platforms, which is useful for kiosks or desktop machines with touch screens.
The API itself is an extension to the QInputContext class, which already deals with input methods, and is actually really simple: Two new events that tell you when to open the panel and when to close it, RequestSoftwareInputPanel and CloseSoftwareInputPanel. All Qt's input widgets support these events and will send them when appropriate. As for how to deliver events from the panel to the widget? Well, that's already there in the form of QInputMethodEvents.
What the input panel developer then needs to do is to make a class which subclasses QInputContext, and in the filterEvent() function you look for the events which tell you show or hide your input widget. If you want to have extra control over what type of input can be used (so the input panel can show only numbers, for example), check out the new inputMethodHints property of QWidget. This property is fully editable in Qt Designer, and some widgets already use it automatically, such as QSpinBox which sets it to numbers only.
Check out the example in Git under examples/tools/inputpanel! It's also documented at http://doc.trolltech.com/4.6-snapshot/tools-inputpanel.html.
Download the latest release here: www.qt.io/download.
Qt 5.15 was developed with a strong focus on quality and is a long-term-supported (LTS) release that will be supported for 3 years.
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Näytä tämä julkaisu Instagramissa.
Want to build something for tomorrow, join #QtPeople today! We have loads of cool jobs you don’t want to miss! http://qt.io/careers #builtwithQt #software #developers #coding #framework #tool #tooling #C++ #QML #engineers #sales #tech #technology #UI #UX #CX #Qt #Qtdev #global #openpositions #careers #job
Henkilön Qt (@theqtcompany) jakama julkaisu