aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Expose "kerning" property for fontsEskil Abrahamsen Blomfeldt2017-06-301-0/+13
| | | | | | | | | | | | For text where the content is known, it can be handy to be able to disable the kerning feature in OpenType to improve performance. [ChangeLog][Qt Quick][Text] Added "kerning" property to the font type to support disabling kerning on text. Task-number: QTBUG-56728 Change-Id: I2e447587a066a7e12c5d38967e0845eaad021014 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+1
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Silence GCC 7 warnings about implicit fallthrough in Qt codeThiago Macieira2017-04-201-0/+1
| | | | | | | | | | | | | | | This only deals with Qt code. MASM has a lot of those left. We should just update from upstream instead to get the fixes. qv4regalloc.cpp:660:52: warning: this statement may fall through [-Wimplicit-fallthrough=] if (leftSource->type == DoubleType || rightSource->type == DoubleType) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qv4regalloc.cpp:666:13: note: here case OpBitAnd: ^~~~ Change-Id: I7814054a102a407d876ffffd14b6b0e2d6b03689 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix warning for -no-feature-shortcutStephan Binner2017-04-181-0/+2
| | | | | Change-Id: I2f6f38af1fb9ecc8a763f9c2d0a45200fd6374af Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Port existing qmlInfo callers to qmlWarningRobin Burchell2017-01-111-1/+1
| | | | | | | | | | | | | Now that qmlInfo actually reports info messages, we want to change existing callers to use warning-level messages to preserve the original message level. This was done through: perl -p -i -e "s/qmlInfo\(/qmlWarning\(/" **/*.{cpp,h,qdoc} .. with a little care taken to only add the hunks that should be changed. Change-Id: I511cee11ce0a26ec1048cd2b84c7536b812a0d89 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add TextInput::textEdited()J-P Nurmi2016-12-301-1/+14
| | | | | | | | | | [ChangeLog][QtQuick][TextInput] Added textEdited() signal to distinguish user edits from programmatical text changes. Change-Id: I1d78499e3e11f9f1cab80ce3b0a6d9f2713219f4 Task-number: QTBUG-57203 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-79/+81
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Accept PUA characters, ZWNJ and ZWJ as input in TextInput/EditEskil Abrahamsen Blomfeldt2016-12-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private Use Area characters are quite valid input characters when used in combination with a custom font. Joiners also serve an important language purpose in semitic writing systems. [ChangeLog][QtWidgets][Input] Support characters in Private Use Area, as well as zero-width joiners and zero-width non-joiners in input in TextInput and TextEdit. Task-number: QTBUG-42074 Task-number: QTBUG-57003 Change-Id: I4a9d6b9ea172d29375c20abfb7aebb6748c5d300 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| * Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-76/+76
| | | | | | | | | | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQuickTextInput: use new QStringRef::isRightToLeft()Anton Kudryavtsev2016-11-121-1/+1
| | | | | | | | | | | | | | | | ... to reduce allocations. Change-Id: Ie18c1f61d0b6f9d3879637d0c57a842f3727cabe Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-11-031-2/+2
|\| | | | | | | | | | | | | Conflicts: tools/qmljs/qmljs.cpp Change-Id: Ifa9e74bdb780eaff22fbc9ba1c514d0078a3fb29
| * Merge remote-tracking branch 'origin/5.7' into 5.8v5.8.0-beta1Liang Qi2016-10-271-2/+2
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: I0b9e5bea5da5d2666887c202e62d889b4aa56900
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-271-2/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickwindow.cpp tests/auto/quick/qquicktext/BLACKLIST tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: I8bd68b0b5e853b7908791d2cbddd18dd527c76ae
| | | * Fix TextInput::selectByMouse documentationMitch Curtis2016-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I41ef6b38e74162434c397535f9d73fff80e29c78 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-221-1/+1
|\| | | | | | | | | | | | | | | Change-Id: I171c7dbb6a74fe743c2eec63e86e9c0bef7c7dfd
| * | | Doc: minor typo in doc TextInput QML typeNico Vertriest2016-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia04ea9a6afefcc1acda3eb6fb466a1faddfb3309 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | QQuickTextInput: replace QString::left with QString::leftRefAnton Kudryavtsev2016-10-141-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce memory allocations. While touching the code, port index-based loop to C++11 range-for loop. Change-Id: I7b11f463177f1355fc8be2b44c7a45a82ba1610c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | | QQuickTextInput: remove reduntant C-style cast to intAnton Kudryavtsev2016-10-121-21/+21
|/ / / | | | | | | | | | | | | | | | | | | All instances are already int. Change-Id: Ieb0a95bffc8c22e0a9cc13e85853f627f0bb511e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-211-1/+6
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmltypeloader.cpp Change-Id: I07647700fc86764c95a5ef95c568e700a70fe45f
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-161-1/+6
| |\| | | | | | | | | | Change-Id: Ib45654e3e79087da4754377f0d78b70c44ed4695
| | * QQuickTextInput: avoid emitting editingFinished twiceRichard Moe Gustavsen2016-09-151-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On platforms like iOS, hiding the virtual keyboard will force the current focus object to lose focus. And when QQuickTextInput loses focus, it will emit editingFinished. To not emit the signal once more directly after hiding the keyboard, we add an extra check in the key event handler to verify that we still have focus. Task-number: QTBUG-44038 Change-Id: Ib64f7028a9f16a172b3c38cab72f3599d560e331 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-191-1/+1
|\| | | | | | | | | | | Change-Id: I326616356ee26d4532c6d57558c43c919f0a900d
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-181-1/+1
| |\| | | | | | | | | | Change-Id: I20c622263f40c322954328e4d10a8071db3ca6d1
| | * Doc: Change instances of 'OS X' to 'macOS'Topi Reinio2016-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change all occurrences where the Mac platform is discussed to use the macro \macos (defined in the documentation configuration in qtbase). Change-Id: Iea114ac73c01d74401bcd77373b41a825d2636c9 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-171-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qv4isel_moth.cpp src/qml/compiler/qv4ssa_p.h src/qml/qml/qqmlobjectcreator.cpp Change-Id: I8bb7fe773d657f908f20ee5e72c2b9bd643f6260
| * | TextInput: fix horizontal alignment when implicit resizing is disabledJ-P Nurmi2016-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, TextInput updates its implicit width to match the content width. This implies that when TextInput does not have an explicit width set, there is no need to handle horizontal alignment. TextField wants to override the default implicit width, so it disables the "implicit resizing" feature of TextInput. In this scenario, the implicit width does not match the content width. Therefore the text layouting code should also treat the item as if it had an explicit width set to achieve the correct horizontal alignment. Task-number: QTBUG-55138 Change-Id: I8c04971a6aff44c6f1734df50153a9788849e98a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | QQuickTextInput: Use qmlobject_connect on clipboard signalRobin Burchell2016-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally raised by Andrew den Exter: http://lists.qt-project.org/pipermail/development/2015-February/020230.html Raises the number of TextInput I can create per frame from around 118 to 128 per frame. Change-Id: I236010a61faf5def59d1f520c32febdbe43d794b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-211-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickflickable_p_p.h src/quick/items/qquickpathview_p_p.h tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp Change-Id: I77664a095d8a203e07a021c9d5953e02b8b99a1e
| * | QQuickTextInput: include padding when reporting anchor rectRichard Moe Gustavsen2016-06-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a padding is set on QQuickTextInput (like controls 2 does), the anchor selection handle ends up at a wrong location. So ensure that we include padding when calculating achor rect (like we do for QQuickTextInput::cursorRectangle()). Change-Id: I356d38443ad891959f3242e254e37961e4965a4c Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-131-37/+36
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsapi/qjsengine.cpp src/qml/qml/qqmlengine_p.h src/quick/items/qquickanchors.cpp src/quick/items/qquickanimatedimage_p_p.h src/quick/items/qquickitem_p.h tests/auto/qml/qqmlecmascript/testtypes.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tests/benchmarks/qml/creation/tst_creation.cpp Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
| * | Use QStringRef to optimize memory allocationAnton Kudryavtsev2016-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. While touching the code, also port loops to C++11 style. Change-Id: I04c99b24ea6afd3715e3edf9ea00bfab838fd53c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| * | QQuickTextInput: Listen for changes to cursorFlashTimeRichard Moe Gustavsen2016-04-211-36/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cursorFlashTime will now change dynamically from QPA while platform controlled text selection (on mobile) is ongoing. This patch will therefore update QWidgetLineControl so that it listens to the cursorFlashTimeChanged signal and changes the blinking rate when triggered. The previous code had a function setCursorBlinkPeriod, which is now changed to setBlinkingCursorEnabled (like in QQuickTextControlPrivate). This is because all callers of the function did either pass "QApplication::cursorFlashTime" or "0", which basically means enable or disable blinking. This moves the control of the blinking rate fully to updateCursorFlashTime, which simplifies the code a bit, especially when cursorFlashTime can change. Note that when setting a blink period to 0, it means "show the cursor without blinking". AFAICS, the current implementation did not guarantee that. This is now made more explicit in the code. If hiding the cursor is needed, a separate function "setCursorVisible" is already available for controlling that. Change-Id: Ie3222525474e03b485ff8585fd8d7da6fd5b26e5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-041-7/+43
|\| | | | | | | | | | | Change-Id: I694ac053b53b669ef5578fd0074de5ce109f7a09
| * | Add support for input method selection handlesJan Arve Sæther2016-04-141-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickTextInput needs to report back Qt::ImhAnchorRectangle, and make it possible to query the cursor position of any given point with inputMethodQuery(Qt::ImCursorPosition, point) Change-Id: Iabe1946e7a8642b51c4601b51e2a13763bdbbd0c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* | | QQuickTextInput: Add some QChar::unicode() calls to brush over deprecation ↵Friedemann Kleint2016-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | warning. Change-Id: Ifb6d499975cf2b7fd7c0d936cfb7daa633be5677 Reviewed-by: hjk <hjk@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devAndy Nichols2016-04-051-8/+12
|\| | | | | | | | | | | Change-Id: I57b06e2e98beb010a56dd0593d93e078ecf76eea
| * | V4: Allow some more functions to be inlined.Erik Verbruggen2016-03-311-1/+1
| | | | | | | | | | | | | | | Change-Id: If9d1f87fd7cf0b12d2827c4574109234be7e8ab8 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-071-5/+10
| |\| | | | | | | | | | Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
| | * Prevent cutting in non-Normal echoMode of TextInputJoni Poikelin2016-03-071-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cutting the text in Password mode led to the text being deleted. Cut and copy operations should not be allowed when echoMode is set to a mode other than Normal. Task-number: QTBUG-51231 Change-Id: If75cdaedac7478ecc1a5126ad4a5ecbf32acd1ab Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| * | QQuickText{Edit,Input}: Reset selection when becoming readOnly.Robin Burchell2016-03-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When read only, controls may not be edited or altered, and indeed, a read-only control cannot acquire a selection (as it cannot be interacted with). Leaving an existing selection breaks that implication, so clear it when becoming read-only. [ChangeLog][QtQuick][TextEdit/TextInput] If a control has a selection, it is now cleared when becoming read-only. Task-number: QTBUG-51115 Change-Id: Ife43b97ee3d6b780f09a938868c3ccb2f1b6e6e7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Add property for setting hinting preference on fontsEskil Abrahamsen Blomfeldt2016-03-151-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As screen density is rapidly increasing and user interfaces are moving more and more towards using unhinted text as default, we have to make it possible to select the hint level from Qt Quick as well. While this is already partially covered by the unhinted QtRendering render type, it is still interesting to be able to tweak the native rendering accordingly, since this is a more precise rasterization. QtRendering also doesn't support medium hinting. [ChangeLog][Text] Added "hintingPreference" property to Text, TextEdit and TextInput. Change-Id: Ib99dbea24aba082481629deddde88c04cdeb8cdb Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Add overwriteMode to QML TextEdit and QML TextInputDan Cape2016-03-031-2/+54
|/ / | | | | | | | | | | | | | | | | | | Overwrite mode was added to QML TextEdit and QML TextInput to match the functionality provided by QTextEdit. Tests were updated as well to ensure the mode functions as expected. Task-number: QTBUG-26513 Change-Id: I1769159b298220107b09f9f13dc3af5f274715cc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | | | | | | | | | | | | 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: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QQuickTextInput: added clear() methodLiang Qi2016-01-191-0/+29
| | | | | | | | | | | | Task-number: QTBUG-50428 Change-Id: I394c2cf1bc397dcbf6d82d3211a6b39519d7582b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | QQuickTextInput: added preeditText propertyLiang Qi2016-01-131-0/+19
| | | | | | | | | | | | Task-number: QTBUG-49503 Change-Id: I803c9fc3bddba81d08e1dd450bc5a5f8a5605720 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-071-1/+10
|\| | | | | | | Change-Id: Ica75a71062d0613e415f2433c5c22c2e251b37cd
| * QQuickTextInput: handle QKeySequence::DeleteCompleteLineJ-P Nurmi2015-11-261-1/+10
| | | | | | | | | | | | | | | | Change-Id: I56bb1f56a9c37137bab322b699d6345e82449c9c Task-number: QTBUG-49643 Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-211-1/+1
|\| | | | | | | Change-Id: I3567f741394f912d4312460e85555b6c39b61cb4
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-171-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/quick/util/qquickimageprovider.cpp Change-Id: I7ca4e49468b5ba697208287be4684e42b9900023
| | * Fix grammar in TextInput documentationMitch Curtis2015-11-021-1/+1
| | | | | | | | | | | | | | | Change-Id: I78ecd97c25da70faf8438dd02d50952d2fb80a22 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>