diff options
31 files changed, 1089 insertions, 115 deletions
diff --git a/.qmake.conf b/.qmake.conf index a2a0d418..aefa1e70 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.7.1 +MODULE_VERSION = 5.8.0 diff --git a/src/config.pri b/src/config.pri index 5a80d1c6..918838bf 100644 --- a/src/config.pri +++ b/src/config.pri @@ -37,6 +37,7 @@ lang-all: CONFIG += \ lang-nb_NO \ lang-pl_PL \ lang-pt_PT \ + lang-ro_RO \ lang-ru_RU \ lang-sv_SE \ lang-zh_CN \ diff --git a/src/virtualkeyboard/3rdparty/hunspell/hunspell.pro b/src/virtualkeyboard/3rdparty/hunspell/hunspell.pro index a5056e82..5421bc4e 100644 --- a/src/virtualkeyboard/3rdparty/hunspell/hunspell.pro +++ b/src/virtualkeyboard/3rdparty/hunspell/hunspell.pro @@ -1,6 +1,5 @@ TARGET = qthunspell -DEFINES += HUNSPELL_STATIC CONFIG += static CONFIG += precompile_header warn_off CONFIG(debug, debug|release) { @@ -10,9 +9,8 @@ CONFIG(debug, debug|release) { config_file = "/* Version number of package */" "$${LITERAL_HASH}define VERSION \"$$VERSION\"" write_file($$PWD/config.h, config_file) -INCLUDEPATH += \ - ./ \ - src/hunspell +MODULE_DEFINES += HUNSPELL_STATIC +MODULE_INCLUDEPATH = $$PWD/src/hunspell SOURCES += \ src/hunspell/affentry.cxx \ diff --git a/src/virtualkeyboard/3rdparty/lipi-toolkit/MIT_LICENSE.txt b/src/virtualkeyboard/3rdparty/lipi-toolkit/MIT_LICENSE.txt new file mode 100644 index 00000000..5d391355 --- /dev/null +++ b/src/virtualkeyboard/3rdparty/lipi-toolkit/MIT_LICENSE.txt @@ -0,0 +1,18 @@ +Copyright (c) 2006 Hewlett-Packard Development Company, L.P. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/virtualkeyboard/3rdparty/lipi-toolkit/qt_attribution.json b/src/virtualkeyboard/3rdparty/lipi-toolkit/qt_attribution.json new file mode 100644 index 00000000..c26f7870 --- /dev/null +++ b/src/virtualkeyboard/3rdparty/lipi-toolkit/qt_attribution.json @@ -0,0 +1,14 @@ +{ + "Id": "lipitk", + "Name": "Lipi Toolkit", + "QDocModule": "qtvirtualkeyboard", + "Description": "Lipi Toolkit (LipiTk) is an open source toolkit for online Handwriting Recognition.", + "QtUsage": "Optionally used in Qt Virtual Keyboard.", + + "Homepage": "http://lipitk.sourceforge.net/lipi-toolkit.htm", + "License": "MIT License", + "LicenseId": "MIT", + "LicenseFile": "MIT_LICENSE.txt", + "Copyright": "Copyright (c) 2006 Hewlett-Packard Development Company, L.P. +Copyright (c) 2007 Hewlett-Packard Development Company, L.P." +} diff --git a/src/virtualkeyboard/3rdparty/openwnn/openwnn.pro b/src/virtualkeyboard/3rdparty/openwnn/openwnn.pro index 6ca93d36..a61e4860 100644 --- a/src/virtualkeyboard/3rdparty/openwnn/openwnn.pro +++ b/src/virtualkeyboard/3rdparty/openwnn/openwnn.pro @@ -4,9 +4,8 @@ VERSION = 1.3.6 CONFIG += static CONFIG += warn_off -INCLUDEPATH += \ - wnnDictionary/include \ - wnnEngine/include +MODULE_INCLUDEPATH = $$PWD/wnnEngine/include +INCLUDEPATH += wnnDictionary/include SOURCES += \ wnnDictionary/engine/ndapi.c \ diff --git a/src/virtualkeyboard/3rdparty/openwnn/qt_attribution.json b/src/virtualkeyboard/3rdparty/openwnn/qt_attribution.json new file mode 100644 index 00000000..9ac944df --- /dev/null +++ b/src/virtualkeyboard/3rdparty/openwnn/qt_attribution.json @@ -0,0 +1,12 @@ +{ + "Id": "openwnn", + "Name": "OpenWnn", + "QDocModule": "qtvirtualkeyboard", + "Description": "OpenWnn is a Japanese keyboard/IME from the Android Open Source Project.", + "QtUsage": "Optionally used in Qt Virtual Keyboard.", + + "License": "Apache License 2.0", + "LicenseId": "Apache-2.0", + "LicenseFile": "NOTICE", + "Copyright": "Copyright (C) 2008-2012 OMRON SOFTWARE Co., Ltd." +} diff --git a/src/virtualkeyboard/3rdparty/pinyin/pinyin.pro b/src/virtualkeyboard/3rdparty/pinyin/pinyin.pro index 8aab0eef..ffa17bfd 100644 --- a/src/virtualkeyboard/3rdparty/pinyin/pinyin.pro +++ b/src/virtualkeyboard/3rdparty/pinyin/pinyin.pro @@ -4,8 +4,7 @@ VERSION = 1.0.0 CONFIG += static CONFIG += warn_off -INCLUDEPATH += \ - include +MODULE_INCLUDEPATH = $$PWD/include SOURCES += \ share/dictbuilder.cpp \ diff --git a/src/virtualkeyboard/3rdparty/pinyin/qt_attribution.json b/src/virtualkeyboard/3rdparty/pinyin/qt_attribution.json new file mode 100644 index 00000000..c739749f --- /dev/null +++ b/src/virtualkeyboard/3rdparty/pinyin/qt_attribution.json @@ -0,0 +1,13 @@ +{ + "Id": "pinyin", + "Name": "PinyinIME", + "QDocModule": "qtvirtualkeyboard", + "Description": "PinyinIME is an input method engine for Pinyin (the official romanization system for Standard Chinese +in mainland China, Malaysia, Singapore, and Taiwan) from the Android Open Source Project.", + "QtUsage": "Optionally used in Qt Virtual Keyboard.", + + "License": "Apache License 2.0", + "LicenseId": "Apache-2.0", + "LicenseFile": "NOTICE", + "Copyright": "Copyright (C) 2009 The Android Open Source Project" +} diff --git a/src/virtualkeyboard/3rdparty/tcime/COPYING b/src/virtualkeyboard/3rdparty/tcime/COPYING index 606b8475..72844840 100644 --- a/src/virtualkeyboard/3rdparty/tcime/COPYING +++ b/src/virtualkeyboard/3rdparty/tcime/COPYING @@ -19,72 +19,72 @@ limitations under the License. File dict_phrases.dat is built from libTabe; the licenses of libTabe is: ================================================================================ -/* - * Copyrighy (c) 1999 TaBE Project. - * Copyright (c) 1999 Pai-Hsiang Hsiao. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * . Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * . Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * . Neither the name of the TaBE Project nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Copyright (c) 1999 Computer Systems and Communication Lab, - * Institute of Information Science, Academia Sinica. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * . Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * . Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * . Neither the name of the Computer Systems and Communication Lab - * nor the names of its contributors may be used to endorse or - * promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ + + Copyrighy (c) 1999 TaBE Project. + Copyright (c) 1999 Pai-Hsiang Hsiao. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + . Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . Neither the name of the TaBE Project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + + + + Copyright (c) 1999 Computer Systems and Communication Lab, + Institute of Information Science, Academia Sinica. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + . Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + Copyright 1996 Chih-Hao Tsai @ Beckman Institute, University of Illinois c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 diff --git a/src/virtualkeyboard/3rdparty/tcime/qt_attribution.json b/src/virtualkeyboard/3rdparty/tcime/qt_attribution.json new file mode 100644 index 00000000..717f87ac --- /dev/null +++ b/src/virtualkeyboard/3rdparty/tcime/qt_attribution.json @@ -0,0 +1,16 @@ +{ + "Id": "tcime", + "Name": "Traditional Chinese IME (tcime)", + "QDocModule": "qtvirtualkeyboard", + "Description": "Traditional Chinese IME (tcime) is an input method engine for traditional Chinese.", + "QtUsage": "Optionally used in Qt Virtual Keyboard.", + + "License": "Apache License 2.0 and BSD 3-clause \"New\" or \"Revised\" License", + "LicenseId": "Apache-2.0 AND BSD-3-Clause", + "LicenseFile": "COPYING", + "Copyright": "Copyright 2010 Google Inc. +Copyrighy (c) 1999 TaBE Project. +Copyright (c) 1999 Pai-Hsiang Hsiao. +Copyright (c) 1999 Computer Systems and Communication Lab, Institute of Information Science, Academia Sinica. +Copyright 1996 Chih-Hao Tsai @ Beckman Institute, University of Illinois" +} diff --git a/src/virtualkeyboard/3rdparty/tcime/tcime.pro b/src/virtualkeyboard/3rdparty/tcime/tcime.pro index 86755635..d593beef 100644 --- a/src/virtualkeyboard/3rdparty/tcime/tcime.pro +++ b/src/virtualkeyboard/3rdparty/tcime/tcime.pro @@ -22,6 +22,8 @@ OTHER_FILES += \ data/dict_cangjie.dat \ data/dict_phrases.dat +MODULE_INCLUDEPATH = $$PWD + load(qt_helper_lib) CONFIG += qt diff --git a/src/virtualkeyboard/content/components/BaseKey.qml b/src/virtualkeyboard/content/components/BaseKey.qml index c45efb32..07989e01 100644 --- a/src/virtualkeyboard/content/components/BaseKey.qml +++ b/src/virtualkeyboard/content/components/BaseKey.qml @@ -191,12 +191,6 @@ Item { */ property bool showPreview: enabled && !functionKey && !keyboard.navigationModeActive - /*! Sets the enabled attribute. - - The default is true. - */ - property bool enabled: true - /*! This property holds the pressed status of the key. The pressed status can only be true if the key is both enabled and active. diff --git a/src/virtualkeyboard/content/layouts/ro_RO/handwriting.qml b/src/virtualkeyboard/content/layouts/ro_RO/handwriting.qml new file mode 100644 index 00000000..ab2600f5 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ro_RO/handwriting.qml @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.VirtualKeyboard 2.1 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.1; HandwritingInputMethod {}', parent) + } + sharedLayouts: ['symbols'] + inputMode: InputEngine.Latin + + KeyboardRow { + Layout.preferredHeight: 3 + KeyboardColumn { + Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width + KeyboardRow { + TraceInputKey { + objectName: "hwrInputArea" + patternRecognitionMode: InputEngine.HandwritingRecoginition + } + } + } + KeyboardColumn { + Layout.preferredWidth: hideKeyboardKey.width + KeyboardRow { + BackspaceKey {} + } + KeyboardRow { + EnterKey {} + } + KeyboardRow { + ShiftKey { } + } + } + } + KeyboardRow { + id: bottomRow + Layout.preferredHeight: 1 + keyWeight: 154 + Key { + weight: 217 + key: Qt.Key_Mode_switch + noKeyEvent: true + functionKey: true + text: InputContext.inputEngine.inputMode === InputEngine.Latin ? "123" : "ABC" + onClicked: InputContext.inputEngine.inputMode = InputContext.inputEngine.inputMode === InputEngine.Latin ? InputEngine.Numeric : InputEngine.Latin + enabled: !(InputContext.inputMethodHints & (Qt.ImhDialableCharactersOnly | Qt.ImhFormattedNumbersOnly | Qt.ImhDigitsOnly)) + keyPanelDelegate: keyboard.style ? keyboard.style.symbolKeyPanel : undefined + } + ChangeLanguageKey { + weight: 154 + customLayoutsOnly: true + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Minus + text: "-" + alternativeKeys: "<>()#%&*/\\\"'=+-_" + } + Key { + key: Qt.Key_Period + text: "." + alternativeKeys: ":;,.?!" + } + Key { + key: 0x102 + text: "ă" + alternativeKeys: "ăîâșț" + } + HideKeyboardKey { + id: hideKeyboardKey + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/ro_RO/main.qml b/src/virtualkeyboard/content/layouts/ro_RO/main.qml new file mode 100644 index 00000000..3524e572 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ro_RO/main.qml @@ -0,0 +1,229 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.1 + +KeyboardLayout { + inputMode: InputEngine.Latin + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_Q + text: "q" + } + Key { + key: Qt.Key_W + text: "w" + } + Key { + key: Qt.Key_E + text: "e" + alternativeKeys: "êeëèé" + } + Key { + key: Qt.Key_R + text: "r" + alternativeKeys: "ŕrř" + } + Key { + key: Qt.Key_T + text: "t" + alternativeKeys: "țţtŧť" + } + Key { + key: Qt.Key_Y + text: "y" + alternativeKeys: "ÿyýŷ" + } + Key { + key: Qt.Key_U + text: "u" + alternativeKeys: "űūũûüuùú" + } + Key { + key: Qt.Key_I + text: "i" + alternativeKeys: "îïīĩiìí" + } + Key { + key: Qt.Key_O + text: "o" + alternativeKeys: "œøõôöòóo" + } + Key { + key: Qt.Key_P + text: "p" + } + Key { + key: 0x102 + text: "ă" + } + Key { + key: Qt.Key_Icircumflex + text: "î" + } + Key { + key: Qt.Key_Acircumflex + text: "â" + } + BackspaceKey {} + } + KeyboardRow { + FillerKey { + weight: 56 + } + Key { + key: Qt.Key_A + text: "a" + alternativeKeys: "aäåãăâàá" + } + Key { + key: Qt.Key_S + text: "s" + alternativeKeys: "șšsşś" + } + Key { + key: Qt.Key_D + text: "d" + alternativeKeys: "dđď" + } + Key { + key: Qt.Key_F + text: "f" + } + Key { + key: Qt.Key_G + text: "g" + alternativeKeys: "ġgģĝğ" + } + Key { + key: Qt.Key_H + text: "h" + } + Key { + key: Qt.Key_J + text: "j" + } + Key { + key: Qt.Key_K + text: "k" + } + Key { + key: Qt.Key_L + text: "l" + alternativeKeys: "ĺŀłļľl" + } + Key { + key: 0x218 + text: "ș" + } + Key { + key: 0x21a + text: "ț" + } + EnterKey { + weight: 283 + } + } + KeyboardRow { + keyWeight: 156 + ShiftKey {} + Key { + key: Qt.Key_Z + text: "z" + alternativeKeys: "zžż" + } + Key { + key: Qt.Key_X + text: "x" + } + Key { + key: Qt.Key_C + text: "c" + alternativeKeys: "çcċčć" + } + Key { + key: Qt.Key_V + text: "v" + } + Key { + key: Qt.Key_B + text: "b" + } + Key { + key: Qt.Key_N + text: "n" + alternativeKeys: "ņńnň" + } + Key { + key: Qt.Key_M + text: "m" + } + Key { + key: Qt.Key_Comma + text: "," + } + Key { + key: Qt.Key_Period + text: "." + } + ShiftKey { + weight: 204 + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Minus + text: "-" + alternativeKeys: [ "\"", "'" ] + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/ro_RO/symbols.qml b/src/virtualkeyboard/content/layouts/ro_RO/symbols.qml new file mode 100644 index 00000000..0196a478 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ro_RO/symbols.qml @@ -0,0 +1,376 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.VirtualKeyboard 2.1 + +KeyboardLayoutLoader { + property bool secondPage + onVisibleChanged: if (!visible) secondPage = false + sourceComponent: secondPage ? page2 : page1 + Component { + id: page1 + KeyboardLayout { + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_1 + text: "1" + } + Key { + key: Qt.Key_2 + text: "2" + } + Key { + key: Qt.Key_3 + text: "3" + } + Key { + key: Qt.Key_4 + text: "4" + } + Key { + key: Qt.Key_5 + text: "5" + } + Key { + key: Qt.Key_6 + text: "6" + } + Key { + key: Qt.Key_7 + text: "7" + } + Key { + key: Qt.Key_8 + text: "8" + } + Key { + key: Qt.Key_9 + text: "9" + } + Key { + key: Qt.Key_0 + text: "0" + } + BackspaceKey {} + } + KeyboardRow { + FillerKey { + weight: 56 + } + Key { + key: Qt.Key_At + text: "@" + } + Key { + key: Qt.Key_NumberSign + text: "#" + } + Key { + key: Qt.Key_Percent + text: "%" + } + Key { + key: Qt.Key_Ampersand + text: "&" + } + Key { + key: Qt.Key_Asterisk + text: "*" + } + Key { + key: Qt.Key_Minus + text: "-" + } + Key { + key: Qt.Key_Plus + text: "+" + } + Key { + key: Qt.Key_ParenLeft + text: "(" + } + Key { + key: Qt.Key_ParenRight + text: ")" + } + EnterKey { + weight: 283 + } + } + KeyboardRow { + keyWeight: 156 + Key { + displayText: "1/2" + functionKey: true + onClicked: secondPage = !secondPage + } + Key { + key: Qt.Key_Exclam + text: "!" + } + Key { + key: Qt.Key_QuoteDbl + text: '"' + } + Key { + key: Qt.Key_Apostrophe + text: "'" + } + Key { + key: Qt.Key_Less + text: "<" + } + Key { + key: Qt.Key_Greater + text: ">" + } + Key { + key: Qt.Key_Colon + text: ":" + } + Key { + key: Qt.Key_Semicolon + text: ";" + } + Key { + key: Qt.Key_Slash + text: "/" + } + Key { + key: Qt.Key_Question + text: "?" + } + Key { + weight: 204 + displayText: "1/2" + functionKey: true + onClicked: secondPage = !secondPage + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + displayText: "ABC" + } + ChangeLanguageKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Period + text: "." + alternativeKeys: ".," + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } + } + } + Component { + id: page2 + KeyboardLayout { + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_AsciiTilde + text: "~" + } + Key { + key: Qt.Key_Agrave + text: "`" + } + Key { + key: Qt.Key_Bar + text: "|" + } + Key { + key: 0x7B + text: "·" + } + Key { + key: 0x221A + text: "√" + } + Key { + key: Qt.Key_division + text: "÷" + } + Key { + key: Qt.Key_multiply + text: "×" + } + Key { + key: Qt.Key_onehalf + text: "½" + alternativeKeys: "¼⅓½¾⅞" + } + Key { + key: Qt.Key_BraceLeft + text: "{" + } + Key { + key: Qt.Key_BraceRight + text: "}" + } + BackspaceKey {} + } + KeyboardRow { + FillerKey { + weight: 56 + } + Key { + key: Qt.Key_Dollar + text: "$" + } + Key { + key: 0x20AC + text: "€" + } + Key { + key: 0xC2 + text: "£" + } + Key { + key: 0xA2 + text: "¢" + } + Key { + key: 0xA5 + text: "¥" + } + Key { + key: Qt.Key_Equal + text: "=" + } + Key { + key: Qt.Key_section + text: "§" + } + Key { + key: Qt.Key_BracketLeft + text: "[" + } + Key { + key: Qt.Key_BracketRight + text: "]" + } + EnterKey { + weight: 283 + } + } + KeyboardRow { + keyWeight: 156 + Key { + displayText: "2/2" + functionKey: true + onClicked: secondPage = !secondPage + } + Key { + key: Qt.Key_Underscore + text: "_" + } + Key { + key: 0x2122 + text: '™' + } + Key { + key: 0x00AE + text: '®' + } + Key { + key: Qt.Key_guillemotleft + text: '«' + } + Key { + key: Qt.Key_guillemotright + text: '»' + } + Key { + key: 0x201C + text: '“' + } + Key { + key: 0x201D + text: '”' + } + Key { + key: Qt.Key_Backslash + text: "\\" + } + Key { + key: Qt.Key_AsciiCircum + text: "^" + } + Key { + weight: 204 + displayText: "2/2" + functionKey: true + onClicked: secondPage = !secondPage + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + displayText: "ABC" + } + ChangeLanguageKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: 0x2026 + text: "\u2026" + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } + } + } +} diff --git a/src/virtualkeyboard/doc/qtvirtualkeyboard.qdocconf b/src/virtualkeyboard/doc/qtvirtualkeyboard.qdocconf index 54b66a00..2698378e 100644 --- a/src/virtualkeyboard/doc/qtvirtualkeyboard.qdocconf +++ b/src/virtualkeyboard/doc/qtvirtualkeyboard.qdocconf @@ -15,7 +15,7 @@ exampledirs += ../../../examples/virtualkeyboard \ examplesinstallpath = virtualkeyboard imagedirs += images -depends += qtdoc qtcore qtgui qtquick +depends += qtdoc qtcore qtgui qtqml qtquick qhp.projects = QtVirtualKeyboard diff --git a/src/virtualkeyboard/doc/src/build.qdoc b/src/virtualkeyboard/doc/src/build.qdoc index 21b0eb2b..1e75ef32 100644 --- a/src/virtualkeyboard/doc/src/build.qdoc +++ b/src/virtualkeyboard/doc/src/build.qdoc @@ -181,7 +181,7 @@ the preferred input method to the configuration, e.g., \c CONFIG+="lang-zh_TW zh \row \li \e static \li Enables static builds of the virtual keyboard - \li This option enables \l {Static build}{static builds}. + \li This option enables \l {Static builds}{static builds}. \row \li \e retro-style \li \e n/a diff --git a/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc b/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc index 92ff3541..94339df7 100644 --- a/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc +++ b/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc @@ -79,6 +79,7 @@ \li Persian/Farsi \li Polish \li Portugese + \li Romanian \li Russian \li Simplified Chinese \li Traditional Chinese @@ -109,6 +110,17 @@ \list \li \l{Qt Virtual Keyboard Examples} \endlist + + \section1 Licenses and Attributions + + Qt Virtual Keyboard is available under commercial licenses from \l{The Qt Company}. + In addition, it is available under the \l{GNU General Public License, version 3}. + See \l{Qt Licensing} for further details. + + Furthermore Qt Virtual Keyboard potentially contains third party + modules under following permissive licenses: + + \generatelist{groupsbymodule attributions-qtvirtualkeyboard} */ /*! diff --git a/src/virtualkeyboard/doc/src/technical-guide.qdoc b/src/virtualkeyboard/doc/src/technical-guide.qdoc index 4832bdc1..7e279bcd 100644 --- a/src/virtualkeyboard/doc/src/technical-guide.qdoc +++ b/src/virtualkeyboard/doc/src/technical-guide.qdoc @@ -56,7 +56,6 @@ The input framework provides the following main interfaces: \li InputEngine: exposes an API to integrate user input events (key presses, etc.) and acts as a host for input methods. \li InputMethod: a base type for QML based input methods. - \li \l {QtVirtualKeyboard::AbstractInputMethod} {AbstractInputMethod}: a base type for C++ based input methods. \endlist \section1 The Input Context @@ -140,8 +139,7 @@ key can be interrupted by using the InputEngine::virtualKeyCancel method. Activating an input method is straightforward. The required steps are: \list - \li Instantiate a concrete implementation of InputMethod or - \l {QtVirtualKeyboard::AbstractInputMethod} {AbstractInputMethod} + \li Instantiate a concrete implementation of InputMethod \li Assign the instance to InputEngine::inputMethod \li Set the proper input mode with InputEngine::inputMode \endlist @@ -579,7 +577,9 @@ style name, the virtual keyboard falls back in the default built-in style. \section2 Adding Custom Styles The process of creating a new style begins by creating a new subdirectory -for the style in the virtual keyboard \e Styles directory. The directory +for the style in a QML import path under the URL-based directory structure +QtQuick/VirtualKeyboard/Styles/. See \l {QML Import Path} +for information about QML import paths. The directory name can not contain spaces or special characters other than underscore. Also, the directory name can not be the same as one of the built-in style, which currently includes "default" and "retro". diff --git a/src/virtualkeyboard/inputcontext.cpp b/src/virtualkeyboard/inputcontext.cpp index df8613ff..06c95d4d 100644 --- a/src/virtualkeyboard/inputcontext.cpp +++ b/src/virtualkeyboard/inputcontext.cpp @@ -93,6 +93,7 @@ public: preeditTextAttributes(), surroundingText(), selectedText(), + anchorRectangle(), cursorRectangle(), selectionControlVisible(false), anchorRectIntersectsClipRect(false), @@ -121,6 +122,7 @@ public: QList<QInputMethodEvent::Attribute> preeditTextAttributes; QString surroundingText; QString selectedText; + QRectF anchorRectangle; QRectF cursorRectangle; bool selectionControlVisible; bool anchorRectIntersectsClipRect; @@ -270,6 +272,12 @@ QString InputContext::selectedText() const return d->selectedText; } +QRectF InputContext::anchorRectangle() const +{ + Q_D(const InputContext); + return d->anchorRectangle; +} + QRectF InputContext::cursorRectangle() const { Q_D(const InputContext); @@ -644,6 +652,7 @@ void InputContext::update(Qt::InputMethodQueries queries) Qt::InputMethodHints inputMethodHints = Qt::InputMethodHints(d->inputContext->inputMethodQuery(Qt::ImHints).toInt()); const int cursorPosition = d->inputContext->inputMethodQuery(Qt::ImCursorPosition).toInt(); const int anchorPosition = d->inputContext->inputMethodQuery(Qt::ImAnchorPosition).toInt(); + QRectF anchorRectangle = qApp->inputMethod()->anchorRectangle(); QRectF cursorRectangle = qApp->inputMethod()->cursorRectangle(); QString surroundingText = d->inputContext->inputMethodQuery(Qt::ImSurroundingText).toString(); QString selectedText = d->inputContext->inputMethodQuery(Qt::ImCurrentSelection).toString(); @@ -653,6 +662,7 @@ void InputContext::update(Qt::InputMethodQueries queries) bool newSurroundingText = surroundingText != d->surroundingText; bool newSelectedText = selectedText != d->selectedText; bool newCursorPosition = cursorPosition != d->cursorPosition; + bool newAnchorRectangle = anchorRectangle != d->anchorRectangle; bool newCursorRectangle = cursorRectangle != d->cursorRectangle; bool selectionControlVisible = d->inputContext->isInputPanelVisible() && (cursorPosition != anchorPosition); bool newSelectionControlVisible = selectionControlVisible != d->selectionControlVisible; @@ -672,6 +682,7 @@ void InputContext::update(Qt::InputMethodQueries queries) d->surroundingText = surroundingText; d->selectedText = selectedText; d->cursorPosition = cursorPosition; + d->anchorRectangle = anchorRectangle; d->cursorRectangle = cursorRectangle; d->selectionControlVisible = selectionControlVisible; d->anchorRectIntersectsClipRect = anchorRectIntersectsClipRect; @@ -699,6 +710,9 @@ void InputContext::update(Qt::InputMethodQueries queries) if (newCursorPosition) { emit cursorPositionChanged(); } + if (newAnchorRectangle) { + emit anchorRectangleChanged(); + } if (newCursorRectangle) { emit cursorRectangleChanged(); } @@ -895,7 +909,21 @@ bool InputContext::filterEvent(const QEvent *event) */ /*! - \qmlproperty int InputContext::cursorRectangle + \qmlproperty rect InputContext::anchorRectangle + \since QtQuick.VirtualKeyboard 2.1 + + This property is changed when the anchor rectangle changes. +*/ + +/*! + \property QtVirtualKeyboard::InputContext::anchorRectangle + \brief the anchor rectangle. + + This property is changed when the anchor rectangle changes. +*/ + +/*! + \qmlproperty rect InputContext::cursorRectangle This property is changed when the cursor rectangle changes. */ diff --git a/src/virtualkeyboard/inputcontext.h b/src/virtualkeyboard/inputcontext.h index fa7e07c6..dbcc7ceb 100644 --- a/src/virtualkeyboard/inputcontext.h +++ b/src/virtualkeyboard/inputcontext.h @@ -56,6 +56,7 @@ class InputContext : public QObject Q_PROPERTY(QString preeditText READ preeditText WRITE setPreeditText NOTIFY preeditTextChanged) Q_PROPERTY(QString surroundingText READ surroundingText NOTIFY surroundingTextChanged) Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged) + Q_PROPERTY(QRectF anchorRectangle READ anchorRectangle NOTIFY anchorRectangleChanged) Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged) Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle WRITE setKeyboardRectangle NOTIFY keyboardRectangleChanged) Q_PROPERTY(QRectF previewRectangle READ previewRectangle WRITE setPreviewRectangle NOTIFY previewRectangleChanged) @@ -84,6 +85,7 @@ public: void setPreeditText(const QString &text, QList<QInputMethodEvent::Attribute> attributes = QList<QInputMethodEvent::Attribute>(), int replaceFrom = 0, int replaceLength = 0); QString surroundingText() const; QString selectedText() const; + QRectF anchorRectangle() const; QRectF cursorRectangle() const; QRectF keyboardRectangle() const; void setKeyboardRectangle(QRectF rectangle); @@ -124,6 +126,7 @@ signals: void surroundingTextChanged(); void selectedTextChanged(); void cursorPositionChanged(); + void anchorRectangleChanged(); void cursorRectangleChanged(); void shiftChanged(); void capsLockChanged(); diff --git a/src/virtualkeyboard/styles/styles_plugin.h b/src/virtualkeyboard/styles/styles_plugin.h index c6d89975..f401fdb9 100644 --- a/src/virtualkeyboard/styles/styles_plugin.h +++ b/src/virtualkeyboard/styles/styles_plugin.h @@ -35,7 +35,7 @@ class QtVirtualKeyboardStylesPlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: void registerTypes(const char *uri); diff --git a/src/virtualkeyboard/trace.cpp b/src/virtualkeyboard/trace.cpp index d87d0a5b..683858af 100644 --- a/src/virtualkeyboard/trace.cpp +++ b/src/virtualkeyboard/trace.cpp @@ -103,13 +103,11 @@ public: \endcode Trace objects are owned by their creator, which is the input method in - normal case. This means the objects are constructed in - \l {AbstractInputMethod::traceBegin()} (C++) or \l {InputMethod::traceBegin()} - {InputMethod.traceBegin()} (QML) method. + normal case. This means the objects are constructed in the + \l {InputMethod.traceBegin()} (QML) method. By definition, the trace object can be destroyed at earliest in the - \l {AbstractInputMethod::traceEnd()} (C++) or \l {InputMethod::traceEnd()} - {InputMethod.traceEnd()} (QML) method. + \l {InputMethod.traceEnd()} (QML) method. */ /*! @@ -167,13 +165,11 @@ public: \endcode Trace objects are owned by their creator, which is the input method in - normal case. This means the objects are constructed in - \l {QtVirtualKeyboard::AbstractInputMethod::traceBegin()} (C++) or \l {InputMethod::traceBegin()} - {InputMethod.traceBegin()} (QML) method. + normal case. This means the objects are constructed in the + \l {InputMethod.traceBegin()} (QML) method. By definition, the trace object can be destroyed at earliest in the - \l {QtVirtualKeyboard::AbstractInputMethod::traceEnd()} (C++) or \l {InputMethod::traceEnd()} - {InputMethod.traceEnd()} (QML) method. + \l {InputMethod.traceEnd()} (QML) method. */ /*! \internal */ diff --git a/src/virtualkeyboard/virtualkeyboard.pro b/src/virtualkeyboard/virtualkeyboard.pro index 44cd01b4..d2ca2b67 100644 --- a/src/virtualkeyboard/virtualkeyboard.pro +++ b/src/virtualkeyboard/virtualkeyboard.pro @@ -159,6 +159,12 @@ contains(CONFIG, lang-pt.*) { t9write: LAYOUT_FILES += \ content/layouts/pt_PT/handwriting.qml } +contains(CONFIG, lang-ro.*) { + LAYOUT_FILES += \ + content/layouts/ro_RO/main.qml \ + content/layouts/ro_RO/symbols.qml \ + content/layouts/ro_RO/handwriting.qml +} contains(CONFIG, lang-ru.*) { LAYOUT_FILES += \ content/layouts/ru_RU/main.qml \ @@ -215,9 +221,8 @@ qtquickcompiler: DEFINES += COMPILING_QML exists(3rdparty/hunspell/src/hunspell/hunspell.h) { SOURCES += hunspellinputmethod.cpp hunspellinputmethod_p.cpp hunspellworker.cpp HEADERS += hunspellinputmethod.h hunspellinputmethod_p.h hunspellworker.h - DEFINES += HAVE_HUNSPELL HUNSPELL_STATIC - INCLUDEPATH += 3rdparty/hunspell/src - LIBS += -L$$OUT_PWD/../../lib -lqthunspell$$qtPlatformTargetSuffix() + DEFINES += HAVE_HUNSPELL + QMAKE_USE += hunspell exists(3rdparty/hunspell/data) { hunspell_data.files = 3rdparty/hunspell/data/*.dic 3rdparty/hunspell/data/*.aff hunspell_data.path = $$DATAPATH/hunspell @@ -245,8 +250,7 @@ pinyin { pinyininputmethod.h \ pinyindecoderservice.h DEFINES += HAVE_PINYIN - INCLUDEPATH += 3rdparty/pinyin/include - LIBS += -L$$OUT_PWD/../../lib -lqtpinyin$$qtPlatformTargetSuffix() + QMAKE_USE += pinyin pinyin_data.files = $$PWD/3rdparty/pinyin/data/dict_pinyin.dat pinyin_data.path = $$DATAPATH/pinyin INSTALLS += pinyin_data @@ -261,8 +265,7 @@ tcime { DEFINES += HAVE_TCIME cangjie: DEFINES += HAVE_TCIME_CANGJIE zhuyin: DEFINES += HAVE_TCIME_ZHUYIN - INCLUDEPATH += 3rdparty/tcime - LIBS += -L$$OUT_PWD/../../lib -lqttcime$$qtPlatformTargetSuffix() + QMAKE_USE += tcime tcime_data.files = \ $$PWD/3rdparty/tcime/data/qt/dict_phrases.dat cangjie: tcime_data.files += \ @@ -288,9 +291,7 @@ openwnn { SOURCES += openwnninputmethod.cpp HEADERS += openwnninputmethod.h DEFINES += HAVE_OPENWNN - INCLUDEPATH += 3rdparty/openwnn/wnnEngine/include - # OpenWNN engine - LIBS += -L$$OUT_PWD/../../lib -lqtopenwnn$$qtPlatformTargetSuffix() + QMAKE_USE += openwnn } lipi-toolkit:t9write: \ @@ -332,8 +333,8 @@ t9write { t9writeinputmethod.h \ t9writeworker.h DEFINES += HAVE_T9WRITE + QMAKE_USE += t9write_db INCLUDEPATH += $$T9WRITE_INCLUDE_DIRS - LIBS += -L$$OUT_PWD/../../lib -lqtt9write_db$$qtPlatformTargetSuffix() LIBS += $$T9WRITE_ALPHABETIC_LIBS } diff --git a/src/virtualkeyboard/virtualkeyboardsettings.cpp b/src/virtualkeyboard/virtualkeyboardsettings.cpp index bbb16092..12bc226e 100644 --- a/src/virtualkeyboard/virtualkeyboardsettings.cpp +++ b/src/virtualkeyboard/virtualkeyboardsettings.cpp @@ -71,10 +71,7 @@ public: for (int i = importPathList.size() - 1; i >= 0; --i) { const QString stylesPath = importPathList.at(i) + QStringLiteral("/QtQuick/VirtualKeyboard/Styles/"); - if (QFileInfo(stylesPath).isDir()) { - styleImportPathList += stylesPath; - break; - } + styleImportPathList += stylesPath; } for (const QString &styleImportPath : qAsConst(styleImportPathList)) { diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 47f3c50a..508e6f97 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -2,4 +2,5 @@ TEMPLATE = subdirs SUBDIRS += \ inputpanel \ + styles \ diff --git a/tests/auto/styles/data/QtQuick/VirtualKeyboard/Styles/test/style.qml b/tests/auto/styles/data/QtQuick/VirtualKeyboard/Styles/test/style.qml new file mode 100644 index 00000000..efb8e3bd --- /dev/null +++ b/tests/auto/styles/data/QtQuick/VirtualKeyboard/Styles/test/style.qml @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Jeremy Katz +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.1 +import QtQuick.VirtualKeyboard.Styles 2.1 + +KeyboardStyle { + +} diff --git a/tests/auto/styles/data/tst_styles.qml b/tests/auto/styles/data/tst_styles.qml new file mode 100644 index 00000000..0b4d3b37 --- /dev/null +++ b/tests/auto/styles/data/tst_styles.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Jeremy Katz +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtTest 1.0 +import QtQuick 2.0 +import QtQuick.VirtualKeyboard.Settings 2.0 + +Item { + + TestCase { + id: testcase + name: "tst_styles" + + function test_style_data() { + return [ + { tag: "default", result: "default"}, + { tag: "retro", result: "retro"}, // in-source alternate style + { tag: "test", result: "test"} // out-of-source alternate style + ]; + } + + function test_style(data) { + VirtualKeyboardSettings.styleName = data.tag; + compare(VirtualKeyboardSettings.styleName, data.result, + "Failed setting VirtualKeyboardSettings.styleName to " + data.result); + } + + function test_unknownStyle() { + var previous = VirtualKeyboardSettings.styleName; + VirtualKeyboardSettings.styleName = "bogus"; + compare(VirtualKeyboardSettings.styleName, previous, + "Unknown style names should be ignored"); + } + } +} diff --git a/tests/auto/styles/styles.pro b/tests/auto/styles/styles.pro new file mode 100644 index 00000000..eda24717 --- /dev/null +++ b/tests/auto/styles/styles.pro @@ -0,0 +1,23 @@ +TEMPLATE = app +TARGET = tst_styles + +QT += testlib +CONFIG += qmltestcase console + +static { + QT += svg + QTPLUGIN += qtvirtualkeyboardplugin +} + +SOURCES += $$PWD/tst_styles.cpp + +TESTDATA = $$PWD/data/* +DEFINES += TESTDATA_DIR=\\\"$$_PRO_FILE_PWD_/data\\\" + +OTHER_FILES += \ + $$PWD/data/tst_styles.qml \ + +DISTFILES += \ + data/tst_styles.qml \ + data/QtQuick/VirtualKeyboard/Styles/test/style.qml \ + diff --git a/tests/auto/styles/tst_styles.cpp b/tests/auto/styles/tst_styles.cpp new file mode 100644 index 00000000..3d2a329f --- /dev/null +++ b/tests/auto/styles/tst_styles.cpp @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Jeremy Katz +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtQuickTest/quicktest.h> +#include <QByteArray> + +static bool s_configImport = qputenv("QML2_IMPORT_PATH", TESTDATA_DIR); +static bool s_configIM = qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); + +QUICK_TEST_MAIN(styles) |