aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput_p_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Accept PUA characters, ZWNJ and ZWJ as input in TextInput/EditEskil Abrahamsen Blomfeldt2016-12-131-0/+2
| | | | | | | | | | | | | | | 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-13/+13
| | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-131-5/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * QQuickTextInput: Listen for changes to cursorFlashTimeRichard Moe Gustavsen2016-04-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+2
|\| | | | | | | Change-Id: I694ac053b53b669ef5578fd0074de5ce109f7a09
| * Add support for input method selection handlesJan Arve Sæther2016-04-141-0/+2
| | | | | | | | | | | | | | | | | | 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>
* | Add overwriteMode to QML TextEdit and QML TextInputDan Cape2016-03-031-0/+2
|/ | | | | | | | | | 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/+1
| | | | | | Task-number: QTBUG-50428 Change-Id: I394c2cf1bc397dcbf6d82d3211a6b39519d7582b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-1/+4
|\ | | | | | | Change-Id: I11ea57222ba5aa683b7bfd7735fbc1d2cf86e875
| * QQuickTextEdit/Input: revise implicit resizing - take twoJ-P Nurmi2015-10-041-6/+2
| | | | | | | | | | | | | | | | Referencing unexported symbols (ExtraData) from an inlined method does not work with MinGW. Change-Id: I19935c84c4e2014f73bcd1801d182d193166bd44 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * QQuickTextEdit/Input: revise implicit resizingJ-P Nurmi2015-10-031-1/+8
| | | | | | | | | | | | | | | | | | | | Rename explicitImplicitSize to better descriptive implicitResize, and add a method to disable the default behavior. QQuickTextField was unable to access the flag directly, because ExtraData is not exported (and we prefer to keep it that way). Change-Id: Ia8b8281267adfc376e03a14882708e9cf80f0451 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Add a way to set default font rendering at build time.Stephen Kelly2015-10-131-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QML text rendering elements have a renderType property controlling whether to use 'Qt' rendering or 'Native' rendering. There is no reason to mix different types of rendering in one static ui. The element-local properties may be used to change the rendering type during animation for example, but otherwise there should be an application-wide rendering mode for text. That means that all Text-based elements in QML should default to the same rendering mode. Additionally, applications wishing to use NativeRendering, wish to use it for all text-based elements, so they require changing the defaults of the elements themselves, still allowing the possibility of changing the rendering mode during animation. Creating third party wrappers for each of the QML text rendering types is not a solution because an application requires the same font rendering for all text. That is, whether written directly with QML Text* elements, or using QtQuick controls, or another 3rd party component set, it is necessary to set the same font rendering mode for all text, except in temporary execptional cases. The known options to achieve this are 1) Create an environment variable to set the default rendering. 2) Add C++ API to set the default 3) Add a build-time option to set the default. The first option is unsatisfying because it is fragile and is easy to get wrong. The second option is incomplete because it does not affect qmlscene etc, so it would require adding a command line argument to qmlscene to change the default. That is unsatisfying because it is also fragile. It is necessary for the sanity of developers and designers (and also end users) that qmlscene use the correct default by default. It must be easy to create qml files for designers to run with qmlscene and which look correct. The third option is the one chosen for this patch. It is most suitable for environments where the Qt build and settings are contained because a particular Qt build is shipped with the application using it (This is the most common way Qt is used). It affects all uses of the text rendering elements, whether used through qmlscene or through another entry point, and it allows changing the property in QML code away from the build-time-determined default. When building Qt, -DQT_QUICK_DEFAULT_TEXT_RENDER_TYPE=NativeRendering may be passed to configure to affect the default rendering for the Qt build. It also leaves the question why the default text rendering is 'Qt' instead of being 'Native', given that many of the Qt controls need to switch to Native anyway (though this depends on the platform and the style). Change-Id: Ib0eed61caf4895b29e5c05e0418fad9962779f85 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* TextInput & TextEdit: allow controls to override the implicit sizeJ-P Nurmi2015-09-061-0/+1
| | | | | | Change-Id: I4b5eae46a9fef574249eee9061858bdf874c54be Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Export QQuickTextInputPrivate and QQuickTextEditPrivateJ-P Nurmi2015-06-231-1/+1
| | | | | | | ...so that QtQuick.Controls 2 TextField and TextArea can inherit them. Change-Id: I9383927c51a70848753a9f41f374d4161000fbb1 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* QQuickTextInput: move paddings into extraDataLiang Qi2015-06-151-19/+17
| | | | | | Task-number: QTBUG-46529 Change-Id: Ifa072dccdf2dc8c52c6865d13ccf1930c92ec51d Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devGabriel de Dietrich2015-03-061-4/+4
|\
| * Fix invocations of static methods of QGuiApplication/QCoreApplication.Friedemann Kleint2015-03-051-4/+4
| | | | | | | | | | Change-Id: I7bcc209b0c6e77cf6d974af85a19487345a48975 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | TextInput: add support for paddingJ-P Nurmi2015-03-051-0/+24
|/ | | | | | | | | | | | | | This makes it possible for TextField to inherit TextInput, reserve space for the decoration, and set the desired property defaults without having to create dozens of property aliases. [ChangeLog][QtQuick][TextInput] Added padding, leftPadding, topPadding, rightPadding and bottomPadding properties. Task-number: QTBUG-41559 Change-Id: Iaa7697a10a6f66685c7cae454edf4c1984d411bc Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-111-21/+11
|\ | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickpainteditem.h src/quick/items/qquickshadereffectsource.cpp src/quick/items/qquickshadereffectsource_p.h Change-Id: If98096443afe85fc4370cef971eace050006a61b
| * Fix cursor blinking for TextInput and TextEditSimon Hausmann2014-08-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before commit fb339b21b8a24b835cea7a057c47b7c5ad80dd72 relied on the simple transparent rectangle node to remain invisible. After that commit we used the regular rectangle node, which doesn't seem to like toggling the color between transparent and solid black and therefore the cursor was always visible. As advised by Gunnar this patch implements a much simpler logic: When the cursor is supposed to be invisible, we just don't create a scene graph node for it anymore. Change-Id: I7b0e173f6d37997559ee0911f37903efdb14847f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* | Add Q_DECL_OVERRIDEAlbert Astals Cid2014-08-141-2/+2
|/ | | | | Change-Id: I2e64950aef710f943c3bc50bc9bf8a1f7fb58d28 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Introduce TextInput::ensureVisible(int position)J-P Nurmi2014-05-211-0/+1
| | | | | | | | | | | | | | | This is required for TextField to be able to implement text selection handles. TextField needs to be able to ensure that the appropriate character position becomes visible when the handles are moved around. [ChangeLog][QtQuick][TextInput] Added TextInput::ensureVisible(int pos) method to be able to control the scrolling position of a TextInput that has automatic scrolling enabled. Task-number: QTBUG-38934 Change-Id: Id77eafcda6324d10868e0798519e5b712a0d33ed Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Makes PasswordMaskDelay configurable through TextInputRisto Avila2014-03-121-0/+2
| | | | | | | | | | | Adds a new property to TextInput which can be used to override QPlatformTheme::PasswordMaskDelay. The new property is TextInput.passwordMaskDelay and takes in delay (ms) which time character is shown before masking it. This is only when echoMode is set to TextInput.Password [ChangeLog][QtQuick][TextInput] Added passwordMaskDelay property Change-Id: I52812b883db11fdd21b25154887c51df8a44f69c Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Update QQuickTextInput's baselineOffset when only height changesJan Arve Saether2014-02-221-0/+1
| | | | | | | Task-number: QTBUG-36529 Change-Id: I2cd577013c4965e76c9350abaebb9b7a6e4e0270 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of the first half of QQmlGuard usageLars Knoll2013-07-051-2/+2
| | | | | | | | | QQmlGuard was being used as a more performant replacement for QPointer. QPointer got now fixed in Qt 5.0, making this class obsolete. Change-Id: I77eef066c4823af4b074ef32d4d78dbd67c36cd0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use the platform theme's password mask character for text input fields.Mitch Curtis2013-04-231-1/+1
| | | | | | | | Task-number: QTBUG-29871 Change-Id: I3b15dfab5ca6455df465c502c93aac7b85a64531 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* TextInput: Handle focus event directlyCaroline Chao2013-03-071-1/+1
| | | | | | | | | Use focusInEvent and focusOutEvent instead of changeItem to handle focus event. (One benefit is the focus events have the focus reason and changeItem doesn't). Change-Id: I164820f375f0ffddc529d59565a3e448b84c6042 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Compile with QT_NO_VALIDATOR.Volker Krause2012-11-301-3/+3
| | | | | | | | Theses enums were apparently renamed for the case QValidator is present, so follow this here as well. Change-Id: Ic2a3fd5296a6dd9da356c2e5efd88f56d0843664 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Enable module build with QT_NO_IMTasuku Suzuki2012-11-261-1/+19
| | | | | | Change-Id: I90f8ec7e6357db7b4038bb1646fe9d3835821556 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix restoration of cursor position and selection after undo/redo.Andrew den Exter2012-07-241-0/+5
| | | | | | | | | If a text selection was deleted, the selection should be restored by an undo, but not if the selection was part of an atomic operation like the DeleteStartOfWord key sequence. Change-Id: Ia37f29c78f6367c60377c539c4e394e014485a49 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Add option to use native rasterizer for SceneGraph textEskil Abrahamsen Blomfeldt2012-07-101-0/+2
| | | | | | | | | | For old-style (desktop components) apps using QML 2 on regular density displays, distance field text will look out of place. We introduce an option to use the native rasterizer instead if you would rather have native look and feel than scalable text items. Change-Id: Idb38e3c89f2deab9ae1963357c6c5fb235ddeab8 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Defer construction of TextEdit/TextInput delegates.Andrew den Exter2012-05-141-1/+8
| | | | | | | | | | | | | | | Don't create instances of the delegate components until the item gains focus, or the cursorVisible property is set to true. Cursor delegates are typically small and relatively fast to create and so won't have a significant cost during a one off focus in event, but that cost can still add up when creating a number of TextInputs or TextEdits at once. If a delegate that is instantiated immeditately is required it is possible to instead create a child item and bind to the cursorRectangle and cursorVisible properties. Change-Id: I5ec2b5b6a30e534aee3dd5a58c6a5ac0686f5ce2 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* QQuickTextInput aligment to follow input method on neutral contentPekka Vuorela2012-04-271-8/+2
| | | | | | | | | | | | Earlier input method was followed only on empty editor. This made inputting one space character with arabic to be visualized left to right. As related change arabic numbers are aligned right even though the flow goes left to right. Change-Id: I36448949569f6290faad69de14df424575d8b97e Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Fix bounding rects of text items.Andrew den Exter2012-04-271-1/+1
| | | | | | | | | | Ensure the rectangles are correctly positioned with right and center aligned text, not just sized correctly. Also add padding to the clip rects so the cursor and styled text aren't clipped at the item boundaries. Change-Id: I03ef140589154ebd49b600b0a4c4fbeff845c10f Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Set cursorVisible to false when im cursor length is 0.Andrew den Exter2012-04-021-2/+3
| | | | | | | | | | | | If the length of the QInputMethodEvent::Cursor attribute is 0 the cursor is supposed to be hidden. To ensure this and any other IM state is reverted when the input method is reset send a empty event to the editor when preedit is cancelled or removed and count formatting or cursor changes when determining if the input method is composing (i.e has state that needs to be reset). Change-Id: Ifca69aa0c18776b1aef355ed6ae9aecc40b9d475 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* TextInput to use password mask delay if platform style defines onePekka Vuorela2012-03-271-4/+0
| | | | | | | Change-Id: I05b98db2d7855f29b11749524a74e04a71178347 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Remove tentative commit from editorsPekka Vuorela2012-03-261-1/+0
| | | | | | | | | Feature to be reimplemented simplified. Now using new FocusAboutToChange event for using input method to commit stuff when window is losing focus. Change-Id: I81c96c36d9f0a1b38adb4324f3b892c33547cb50 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Fix text wrapping and eliding with implicitWidth.Andrew den Exter2012-03-221-1/+6
| | | | | | | | | | | | Update the implicitWidth of the item before continuing with the layout rather than after it's completed this gives any bindings dependent on the implicitWidth the opportunity to update the width before the layout continues. Task-number: QTBUG-22680 Task-number: QTBUG-24251 Change-Id: I61cd96ad9891b22d8b83937ad2c06719f88976b6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove unused init function.Andrew den Exter2012-03-131-1/+0
| | | | | Change-Id: Id66e177a544fd8e019bae86fff6bd04bd0497d7c Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-6/+7
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
| * Use floating point types for position offsets and cursorRectangle.Andrew den Exter2012-02-241-6/+7
| | | | | | | | | | | | | | | | | | Rounding to align painting to pixel boundaries is no longer necessary are largely removed. Correct the few instances remaining in TextEdit and TextInput. Change-Id: Ic6ec57092d74ec43b23d85cd8868e0190acc3e09 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* | Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-4/+4
|/ | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Reduce the size of QQuickTextInputPrivate.Andrew den Exter2012-02-221-63/+49
| | | | | | | | Remove some redundant or obsolete member and reorder members to minimise padding for alignment. Change-Id: I2660007baa07bea076e9ad307061af87c07e37cf Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Remove commit headersAaron Kennedy2012-02-201-1/+0
| | | | | | | | These were used when we were porting from QtQuick 1 to QtQuick 2 but are no longer necessary. Change-Id: I0eeb7e13b4affdd6ab6c6dddea760afcdf38ee4f Reviewed-by: Martin Jones <martin.jones@nokia.com>