aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQuickTextInput: update cursor rectangle after padding changedWang Chuan2021-04-161-0/+5
| | | | | | | | | | | The position of cursor delegate needs to be updated when we change padding, otherwise it will be in a wrong position. Fixes: QTBUG-91867 Change-Id: I89ca84fe893ebf517ab67890196eede14a4055d7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit d98694c4023881673259ba040c10df7e71ec3d37) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktextinput: ensure we update IM when cursor changes positionRichard Moe Gustavsen2021-03-301-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally the cursor will change position inside a text input after receiving a touch or a keypress event. But it can also change position by sending it a QInputMethodEvent. But as it stood, we would in that case not inform the platform input context about it, which meant that the IM state in QQuickTextInput would be different from the IM state in QPA. A bug on iOS could be seen from this when dragging the cursor around using the magnifier glass. In that case QIOSTextResponder would move the cursor in QQuickTextInput using QInputMethodEvents. But since this would not be forwarded back to UITextInput, the result would be that if you e.g pushed backspace on the input panel, you would delete the character at the position the cursor had before the drag. This patch will ensure that we update platform IM state whenever the cursor changes position from QInputMethodEvents. Fixes: QTBUG-72757 Change-Id: Ic39c60fbce982f80d014befddbb2d4439ddeea4f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 04c0615352e947a23bcd52a0da4f901b3decdb87) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktextinput: Fix validation for IM eventBartlomiej Moskal2021-02-191-1/+19
| | | | | | | | | | | | | | | | | | If validation did not pass after text pre-editing is finished, it need to be roll back to state before pre-editing started. Before this change, if validation did not pass, text was always rolled back to previous state. In pre-editing text case, it means back to the state in which part of the text was removed (and later changed to pre-edited text). It may cause a situation of removing part of the text that was already validated Fixes: QTBUG-90239 Change-Id: I3ec39e0f6b8a93d4e6fd190af30d4c80a0e495eb Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit b1ae151acc80254ab0ec2937c55b99223205875c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktextinput: Fix Undo history for IM eventBartlomiej Moskal2021-02-151-4/+6
| | | | | | | | | | | | | | | | | | | Do not set m_cursor (cursor position) before calling removeSelectedText() in processInputMethodEvent(QInputMethodEvent *) method. Before this change, DeleteSelection command was added to history with new cursor position. If this command will be later rolled back, cursor position will not be set correctly. It should be set to position before handling the event. Task-number: QTBUG-90239 Change-Id: Ib5e46d232e6b32f904e745da4f9e5bc03a58963f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 6ec8c62ca22c363fa00e085de10198a90e3d65dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTextInput: Store mask data in std::unique_ptrFabian Kosmale2020-11-241-4/+2
| | | | | | | | | | This ensures that the memory is freed reliably Fixes: QTBUG-88807 Change-Id: I841a5a2b226a69ce50975d95702a948857d1b54f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit d2d8e90e9f218103d60737e1273ab5322834d9ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktextinput: compile with explicit QChar(int) constructorDavid Faure2020-11-091-11/+11
| | | | | Change-Id: I78fe89cd97b462299969d57cda099ce54fa8078a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Use OpenType font weightsJonas Karlsson2020-08-281-1/+1
| | | | | | Task-number: QTBUG-42248 Change-Id: Ib26d4945307b630b054e270b3213e1c9ad0d5357 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Replace Qt's MidButton with MiddleButtonEdward Welbourne2020-07-221-1/+1
| | | | | | | | | | The latter has been the preferred name since Qt 4.7.0. Added a comment on where the old name is exposed to QML that it's only for backwards compatibility. Pick-to: 5.15 Change-Id: I2c5088d597dd7327cc5899d06afb180d0ec2893e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add ; to Q_UNUSED and UNUSED_PARAMLars Schmertmann2020-06-261-2/+2
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Port QtDeclarative from QStringRef to QStringViewKarsten Heimrich2020-06-161-5/+5
| | | | | | | | Task-number: QTBUG-84319 Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QQuickTextInputPrivate: refactor getImplicitWidth() to calculateImplicitWidth()Mitch Curtis2020-06-121-23/+27
| | | | | | | | | | | | This patch moves the implicit width calculation in getImplicitWidth() into calculateImplicitWidth(const QString &text). This allows QQuickComboBox in qtquickcontrols2 to get the implicit width of a TextInput (TextField) item, as QQuickTextInput does some extra layouting and accounting for padding that QFontMetrics does not. Change-Id: I81e6c2627e21ca4d89ea9502abbb6aec79068793 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-111-8/+8
| | | | | | | | | | | | | | | | | | | | Several event accessors were deprecated in qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5. Replacements were generated by clazy using the new qevent-accessors check: $ export CLAZY_CHECKS=qevent-accessors $ export CLAZY_EXPORT_FIXES=1 $ ../qt6/configure -platform linux-clang -developer-build -debug -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy $ make $ cd ../../qt6/qtdeclarative $ find . -name "*.clazy.yaml" $ clang-apply-replacements . Task-number: QTBUG-20885 Task-number: QTBUG-84775 Change-Id: I1be5819506fd5039e86b4494223acbe193e6b0c9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-241-2/+1
|\ | | | | | | Change-Id: I77f3400914fbce58f98cb3a5602fd0cebf219ac6
| * Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-04-221-2/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/labsmodels/qqmltablemodel.cpp tests/auto/qml/qqmltablemodel/tst_qqmltablemodel.cpp This follows edc8512580fa16892dc13034e93300cc6a2bba59. Change-Id: I515d44d5d8309f4d7b911996c0ab65ea803176fa
| | * Don't replace all characters below 0x20 with spaces as they may be validAndy Shaw2020-03-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some fonts will still render something for characters below 0x20 so these should not be replaced with a space and should just be left as is. It will not be rendered as a box if the dontPrint flag is set so we can trust the renderer to do the right thing here. Change-Id: Ie091c14713d8c2948c82b1991c295d80bc35dfde Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | QQuickItem: rename geometryChanged to geometryChangeMitch Curtis2020-04-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings it in line with the existing convention in this and other modules, where virtual handlers are named "nounChange"; e.g. itemChange. Signals are named "nounChanged". This also allows adding a geometryChanged signal, which would enable users to listen to one signal for all changes to x/y/width/height. [ChangeLog][QQuickItem] Renamed geometryChanged to geometryChange in order to follow existing naming conventions and have consistency with existing API, such as itemChange. Task-number: QTBUG-82994 Change-Id: I0547358c796a0047982ccfbf2c38bab952e7a634 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Remove QRegExpValidator usagesLars Knoll2020-03-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also means the RegExpValidator QML type will be gone. Use QRegularExpressionValidator instead. [ChangeLog][QtQuick][RegExpValidator] The RegExpValidator QML type has been removed. Use RegularExpressionValidator instead. Change-Id: If25fc5a258a669dfd28e705271757caa252ce05c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-111-6/+0
|\| | | | | | | | | | | Change-Id: I0d32fc5b99f8c9e4acb922fffe4dd5f3c5be553c
| * | Remove hard-coded notes for 'Corresponding handler' for QML signalsTopi Reinio2020-03-101-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | QDoc will generate these notes automatically. Task-number: QTBUG-37355 Change-Id: I8ed058ecbbcc630ad0351f6ce167c3fa61936f6f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-301-0/+12
|\| | | | | | | | | | | Change-Id: I1e1d9585d876a8eacd4c24afc894a33075f51a13
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-291-0/+12
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp Change-Id: I133bfd4bd9dd6f704252c956c90f05e8a8a40d6a
| | * Doc: document behavior and caveats of TextInput's padding propertiesMitch Curtis2020-01-281-0/+12
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-80699 Task-number: QTBUG-81679 Change-Id: I9c936a020ffa358dfa97d9b7044a90a27d3336dc Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Make Font.weight an integer instead of enumerationEskil Abrahamsen Blomfeldt2020-01-211-4/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The weight in QFont is an integer, allowing you to request a font of any weight given the predefined scale. In Qt Quick, however, you were limited to the predefined values. This is done in Qt 6 because it breaks conversions from string to weight, as the change in the autotest illustrates. [ChangeLog][Font] Made Font.weight an integer value rather than limit it to a predefined set of weights. As a side effect, conversion from strings to font weights are no longer supported. Fixes: QTBUG-80402 Change-Id: Ifbe9a0e608b63bfa93bb54999b0b3c1851ccfa88 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* / Make inputmask 'X' mask character require non-blank inputEirik Aavitsland2019-12-101-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | The implementation for the X mask would accept any printable character. Since that includes the blank character, there was no difference in behavior between the requiring X and optional x: both would allow the input to be unset, i.e. blank. This change should be seen in conjunction with the doc improvement qtbase:da0af1e and the corresponding change to the QLineEdit widget, where the same input mask handling code is duplicated. This patch series also concludes the old task questioning whether text() should strip blanks even when they are valid input (answer: yes, continue to do that), and so a couple of XFAILS was removed from the autotest. [ChangeLog][QtQuick][TextInput] Inputmask X character now requires non-blank input. Task-number: QTBUG-76320 Change-Id: I606ae04259f29f748b3ce604048c6eb6f10c2ff9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Do not emit inputMaskChanged when setting the same input maskJan Arve Sæther2019-12-021-1/+4
| | | | | | | | | | | | | If you did not specify a blank character (e.g. "; " as suffix) it would internally add that suffix to the property, resulting in that the property itself actually got a "; " suffix even when not specified. So when setting the same input mask again, it wouldn't match the existing inputMask property, and it would emit inputMaskChanged again. Change-Id: Ia47d63d56c640b4be9d6d0a704ddfaff01befbdb Fixes: QTBUG-80190 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-151-2/+2
|\ | | | | | | Change-Id: I7759f6b60f8fda6525b239c7ee2e034194d4ab85
| * QQuickTextInput::remove: Fix selection logicFabian Kosmale2019-10-111-2/+2
| | | | | | | | | | | | | | | | Fixes: QTBUG-77814 Change-Id: I96b8990656117430eb12fc4b294a8ece612d3a4b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Small performance improvements suggested by clang-tidyAlbert Astals Cid2019-10-071-1/+1
| | | | | | | | | | | | | | | | | | mostly add const &, a few std::move and in particular case, remove const so the std::move being done over the variable actually has effect Change-Id: Id611cd31bc012f219d7a17d4626b1c2a5fbddd66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-121-12/+13
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp src/quick/handlers/qquicktaphandler.cpp src/quick/items/qquicktableview.cpp Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io> Done-With: Ulf Hermann <ulf.hermann@qt.io> Done-With: Shawn Rutledge <shawn.rutledge@qt.io> Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
| * Doc: Fix documentation warnings for qtdeclarativeTopi Reinio2019-08-291-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After recent changes to QDoc, it now correctly warns about missing documentation for QML method parameters - fix all of these and also do some minor language editing. Remove duplicated entries for - \qmlmodule Qt.labs.qmlmodels - \group qtjavascript as they were causing issues. Change-Id: I55cd670cc8a0cc6427cdb7945dbd7c28ea94f796 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Register QRegularExpressionValidator in QtQuickUlf Hermann2019-06-121-3/+4
|/ | | | | | | | This should replace QRegExpValidator. RegExpValidator is deprecated now. Task-nunber: QTBUG-72588 Change-Id: I072deb382914fd322ce192509782b241824ccd7b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* 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>