aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-011-0/+6
|\ | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp Done-With: Erik Verbruggen <erik.verbruggen@qt.io> Change-Id: I3ae3d64317e4f3fccba6605f4c6da15479ca75e0
| * TextInput: Stop leaking password values to process memoryIvan Čukić2019-01-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The contents of a deleted QString can still remain in memory and can be accessible by tools that read the raw process memory. The same problem appears when the QString reallocates -- the old buffer gets deleted, but its contents will remain in memory. This means that a TextInput that serves as a password input field can leak parts of the password while the user is entering it (due to reallocation) and the whole password when the TextInput instance is destroyed. With this patch, the contents of the m_text string member variable will be zeroed-out before the TextInput is destructed. This is done only in the cases when the TextInput serves as a password field. Also, this patch reserves the space for 30 characters for m_text when the TextInput is used for password input. This is enough to make sure no reallocation happens in majority of cases as barely anyone uses passwords longer than 30 characters. [ChangeLog][QtQuick][TextInput/security] When the TextInput is used for password input, preallocate a buffer for the string that stores the entered value and zero-out the string on TextInput destruction to avoid leaking sensitive data to process memory Change-Id: I8f1f307b1cfc25ad51f48bae8509a258042a2e7f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Fix QFont-related deprecation warningsFriedemann Kleint2019-01-081-2/+2
|/ | | | | | | | | | | | | | Replace QFontMetrics::width() by horizontalAdvance(), fixing: items/qquicktextcontrol.cpp:1001:80: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/qquicktextinput.cpp:880:60: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/qquicktextinput.cpp:1380:60: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:2980:57: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:4060:36: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:4063:36: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] Change-Id: Ie97be4a6cf1ce087caeb4d83fe016fa1a471f3ec Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-191-1/+1
| | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-6/+6
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.10' into 5.11Liang Qi2018-02-121-27/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/shapes/qquickshape.cpp src/imports/shapes/qquickshape_p_p.h src/qml/compiler/qqmlpropertycachecreator_p.h src/qml/jsruntime/qv4value_p.h src/quick/items/qquickloader_p.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tools/qmlprofiler/qmlprofilerapplication.cpp Change-Id: Iafc66ae84bf78630ed72a986acb678e9d19e3a69
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-02-021-27/+9
| |\ | | | | | | | | | Change-Id: I41ca9120a470a905c2f5c168c1de4cf970fa0fff
| | * Prevent invalid characters being entered at the appropriate timesAndy Shaw2018-02-021-27/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a validator does not allow for certain characters to be entered, then it should not allow these to be entered in even if an input mask is set. This fixes a regression introduced in 1b21b73e89942d567c90a17a3bf7a7ecae3de258. The test modified is because this is in fact a general limitation when combining validators and input masks, when a separator is used. Whereas the original patch did allow this to be possible, this is now not possible again. Task-number: QTBUG-64616 Change-Id: Ic6a3f40a9faa7c04abc055cfc2752044fddd33a0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | | Fix misleading doc for kerningRobert Loehning2018-02-081-3/+3
|/ / | | | | | | | | | | | | | | | | | | It currently sounds as if activating kerning would speed up drawing while the opposite is true. Change-Id: I7ba8caa82931617213c70570b6b81f82d5b61e52 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Add property to disable shaping on fontsEskil Abrahamsen Blomfeldt2017-08-251-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Major performance improvements can be gained if you know for sure your text does not require any shaping features. This patch adds Qt Quick support for the QFont::PreferNoShaping flag (though as a boolean property to work better with property bindings). [ChangeLog][QtQuick][Text] Added "font.preferShaping" property to Text, TextEdit and TextInput. This makes it possible to improve performance at the expense of some cosmetic font features. Task-number: QTBUG-56728 Change-Id: Ib4e23d5b21b9d4929562df521347285b2586a62e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add a way to set the default render type of text-like elementsGiuseppe D'Angelo2017-08-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f3446071da8357620d0c8593a04e3b4fbba88f21 introduced a build-time way to select the default render type of text-like elements. This patch adds also a way to select it at runtime, via a setter on QQuickWindow. (QQuickWindow has been chosen as convenience, rather than adding another namespace/class to just have this setter.) Given that QT_QUICK_DEFAULT_TEXT_RENDER_TYPE was never documented, I've taken the liberty of changing the accepted values for it (to match the new enumerator names in QQuickWindow, rather than the ones in QQuickText/QQuickTextEdit/etc.). [ChangeLog][QtQuick][QQuickWindow] It is now possible to set the default render type of text-like elements globally via the QQuickWindow::setTextRenderType() function. If you were using the (undocumented) QT_QUICK_DEFAULT_TEXT_RENDER_TYPE macro when building Qt Quick for the same purpose, note that the macro value needs now to be set to the "NativeTextRendering" value, instead of "NativeRendering". Change-Id: Id4b2dc3ec823971486e445ca4173b8be848fb4e3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-08-181-0/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/qml/qqmlcustomparser.cpp src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypenamecache.cpp src/qml/qml/qqmltypenamecache_p.h src/qml/qml/qqmltypewrapper.cpp src/qml/qml/qqmltypewrapper_p.h src/qml/qml/qqmlvmemetaobject.cpp src/qml/util/qqmladaptormodel.cpp Change-Id: Ic959d03e6f9c328fb02710d9abbb0f27cddde131
| * QQuickTextInput: Allow going from an Acceptable to an Intermediate stateAndy Shaw2017-08-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | When editing text with a validator set then it can happen that it would no longer be in the acceptable state. This ensures that it does not prevent editing the text when an input mask is used to go back to an Intermediate state. Change-Id: I6da533d18035e9da468939c28a961bc8f2f3090b Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-07-281-2/+2
|\| | | | | | | Change-Id: I7d092cce33cb009d63e7b0df7c71183089dea53f
| * QQuickTextInput: Don't move the cursor after internalInsert() has done soAndy Shaw2017-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | internalInsert() will set the cursor to the right position which accounts for any input mask set on the control as well. Therefore it will already be placed at the next correct position and should not be changed again after that. Task-number: QTBUG-40943 Change-Id: Ic80193ee94d2aa002b5a14a88df719a5a2cf51b1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | doc: Use correct class in docs for font.kerningEskil Abrahamsen Blomfeldt2017-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Copy-pasted the docs for Text.font.kerning into TextEdit and TextInput and forgot to change the class name in the example. Amends 441e0b41bf5b700cdaa3b0ba2393c487ed4b9de5. Task-number: QTBUG-56728 Change-Id: Ieab27efb51fa702d83b891e3c7b7aeb5e4795fc5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | 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>