summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtBase: use printf-style qWarning/qDebug where possible (II)Marc Mutz2016-05-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this second part, replace qWarning() << "" << non-QString with qWarning("..%.", non-QString). QString (and QUrl etc) have special escaping handling when streamed into QDebug, so leave those alone. They also seem to expand to less code than the qPrintable() alternative, so there's no reason to replace them. Saves 2KiB, 3.4KiB, ~750b and ~450b in text size in QtCore, Gui, Network and Widgets, resp., on optimized GCC 5.3 AMD64 builds. Change-Id: Iae6823e543544347e628ca1060d6d51e3b04d3f4 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QtBase (remainder): use printf-style qWarning/qDebug where possible (I)Marc Mutz2016-03-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "" with qWarning("..."). Had to fix broken qImDebug() definition. Instead of defining it as a nullary macro in the QT_NO_DEBUG case and as a variadic macro in the other, define it in both cases, as is customary, as a non-function macro so that overload selection works without requiring variadic macro support of the compiler. Saves e.g. ~250b in text size in QtPrintSupport on optimized GCC 5.3 AMD64 builds. Change-Id: Ie30fe2f7942115d5dbf99fff1750ae0d477c379f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-13/+19
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-021-54/+54
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-54/+54
| | | | | | | | | | | | | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-14/+13
|/ | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* qqnxinputcontext: Add support for EnterKeyTypeKai Uwe Broulik2015-07-191-1/+5
| | | | | Change-Id: I03b9d70b9bb05cd28fdcbb076764a2e1d9e3e0e3 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-6/+6
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QNX: Add support for BB10 text highlighting and spell checkingRoger Maclean2013-12-241-53/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the QPA side of the support for text highlighting during text entry and for spell checking. The changes are compatible with existing Qt text controls though require more advanced ones to have any effect. QQnxInputContext has three colors it can now use for highlighting text during composition to represent the active region, auto corrected text and reverted text. If any of these colors is invalid, that form of highlighting is not used. By default, only the active region color has a valid default which corresponds to the highlighting capabilities of classes such as QQuickTextInput. The QNX QPA native interface has been augmented with the ability to get a function pointer that can be used to set any or all of the three colors. The set of colors is reset to the default at any time that focus changes to ensure appropriate behavior if there is a mix of controls. It's worth noting that while the colors can be changed even when used with one of the standard Qt text controls, the auto-correct color will not show up since it is applied immediately before committing the text. Appropriate display of this highlighting requires that the control maintain the highlighting for a period after committing the text. Spell checking is provided via another function accessible through the QNX QPA native interface. This takes a string and a callback function to be called once spell checking is complete. As a slightly unrelated change, toSpannableString now uses toWCharArray to convert the QString to UTF-32 as required by IMF, the previous code was invalid in the case of strings containing UTF-16 surrogate pairs. Removed some extraneous includes. Change-Id: Ifdf3744d1990e0560d1923bca5db30953dea0192 Reviewed-by: Roger Maclean <rmaclean@qnx.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
* BB10: Clean up IMF session codeRoger Maclean2013-11-191-10/+16
| | | | | | | | | | | | | | | Be more rigorous about checking if we're in a session before invoking IMF functions. In particular the code would call initEvent if a key was received while no text field had focus leading to a crash. Also closeSession is now always called when a session is terminated rather than just setting sInputSession to 0 and hasSession is always called to check for a valid session. Change-Id: I22ce1c9bcdf8dd130f05ae319c4cc1e01afc4456 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Add support for BB10 input method frameworkRoger Maclean2013-10-251-848/+611
| | | | | | | | | | | | | | | | | | | | | | | | | Added input method support for the BB10 variant of Qt to the extent possible using standard Qt APIs. This adds support for text predictions and entry of languages such as Chinese. Change in interface to QQnxAbstractVirtualKeyboard was made because it is felt the new one is slightly nicer. It doesn't appear safe to assume the focus object has a particular property and in fact in my tests the code failed to work. In some cases the code uses variable and function naming at odds with normal Qt coding standards. This has been done for functions called and data provided by the BB10 input system as for those of us who need to maintain such things, it makes their meaning considerably clearer. While qqnxinputcontext_imf.cpp was used as an initial base for development one can consider the new version as largely new code. I don't believe the original version was ever complete and in any event would not compile. Change-Id: I09470801ffa237cee67da40c0b3d02ed5c77531e Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* QNX: normalize bracesRafael Roquetto2013-05-231-12/+7
| | | | | Change-Id: I05f140a0626e543535cc74c6f737be9be1e27a5d Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* QNX: Code cleanup: normalize 'if' macro usageRafael Roquetto2013-03-261-2/+2
| | | | | | | | | Always use "if defined" instead of "ifdef". The same is valid for "ifndef" macros Change-Id: I8e8f65e36dc636c10b3d656ce9a89ab3a664a80b Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* QNX: Add support for QInputMethod::keyboardRectangle()Oleg Shparber2013-02-081-1/+11
| | | | | Change-Id: Ie23aa06fed5778e228abf0f35fc1136a86661771 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QNX: code cleanup, use '0' instead of 'NULL'Rafael Roquetto2012-10-131-5/+5
| | | | | | | Qt coding style uses always 0. NULL is wrong. Change-Id: I163677b512214f853677d21d75f13142fe2ca88d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Blackberry: Support input method hintsThomas McGuire2012-09-281-4/+1
| | | | | | | Change-Id: I2d30d6079d3982e5ca2b8d9346d0d511279792ad Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-23/+23
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QNX: Reduce dependency on QtWidgetsKevin Krammer2012-07-291-4/+1
| | | | | | | | Use QObject::inherits() to check if the current input focus object is a numerical input instead of trying to cast. Change-Id: Ie476fba3d2f9f20a1ce0328043430cb6a96a8a3d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QNX: Rationalise the usage of qDebug() to remove lots of #ifdef'sSean Harmer2012-05-251-177/+72
| | | | | | Change-Id: I097e4af86a6a0941f4fd7e122970f88ba536ab38 Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: Andriy Golovnya <andriy.golovnya@googlemail.com>
* Adapt QNX platform input contexts to QGuiApplication::focusObject()Pekka Vuorela2012-04-021-38/+18
| | | | | | | Change-Id: I4c5028f76b52e3838231eff2a599e85347c16598 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Separate virtual keyboard interface and implementationKevin Krammer2012-03-301-4/+4
| | | | | | | | | | Allows us to create a BPS based implementation and drop it in without further changes to users of the interface. Change-Id: I16313717e1200d717c330cbb18c3314567af51c2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Refactoring virtual keyboard class into non-singletonKevin Krammer2012-03-281-10/+14
| | | | | | | | | | | | | Getting rid of the singleton gives us better control over when the virtual keyboard handling class is instantiated and configured. Also notify screens about keyboard height changes and let them notify through QWindowSystemInterface instead of "guessing" the screen in QQnxVirtualKeyboard. Change-Id: I71a7f6b5e9d5455563404f6abe7a0daec567a12d Reviewed-by: Sean Harmer <sh@theharmers.co.uk> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Rename blackberry QPA plugin to QNXSean Harmer2012-03-121-0/+1696
Changing the naming scheme from Blackberry to QNX in line with pattern of using platform names. Change-Id: I048a6a18010bc932311d63c8dde19ccab97894c8 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>