aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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 uses of various qml doc commandsBea Lam2012-08-081-7/+7
| | | | | | | | | | | | | | Signals documented with \qmlsignal should indicate handler name, i.e. 'onSignal' rather than 'signal'. Methods documented with \qmlmethod do not need to document 'void' return values. Also the name of any documented attribute should be qualified with 'QtQuick2::<qmltype>'. Change-Id: I206dd9e8f39c3b84e029ae9d4101b05d0bfb3478 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Fix pasting with the middle button in TextInput and TextEdit.Andrew den Exter2012-08-061-1/+7
| | | | | | | | Neither item accepted the middle button which prevented the mouse events ever reaching them. Change-Id: Ia8f693099df4d6c248976453d554fef96d1d3b33 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add tests for copy and paste using keyboard shortcuts.Andrew den Exter2012-08-061-2/+4
| | | | | | | Fixes TextInput.cut() removing text while read only. Change-Id: I03cd44d381be9d53f71ba168b8be7971ab0bbad7 Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
* Fix various broken links in documentationBea Lam2012-08-031-0/+4
| | | | | Change-Id: I9e2dac37d18e3ca62e4a92be25e5c2e60ffeba00 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Doc: Changed \qmlclass to \qmltype and added \instantiates.Jerome Pasion2012-07-301-4/+8
| | | | | | | | | | -To simplify QDoc, \qmlclass is now \qmltype. -'\instantiates <C+++ class>' is for the types that are defined in C++. Change-Id: I29242d33daf7b972d8b86a356b9689638866b950 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Fix restoration of cursor position and selection after undo/redo.Andrew den Exter2012-07-241-35/+98
| | | | | | | | | 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>
* Update element references to smooth.Michael Brasser2012-07-181-15/+0
| | | | | | | Change-Id: Ide30946e83c8c26d075b9ca3bb1f9e20afd69373 Reviewed-by: Glenn Watson <glenn.watson@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-1/+1
| | | | | | | | | | | | | | | | QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Change Quick docs to refer to "types" rather than "elements"Martin Jones2012-07-161-5/+5
| | | | | | Task-number: QTBUG-24785 Change-Id: I223479b879514abaacb123852323c1cfada7a5e1 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Use QQuickTextUtil to calculate alignment offsets in TextInput.Andrew den Exter2012-07-111-24/+4
| | | | | Change-Id: I8602f949c01cb4c5a3b05de5a2800dead0ae8b47 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add option to use native rasterizer for SceneGraph textEskil Abrahamsen Blomfeldt2012-07-101-1/+38
| | | | | | | | | | 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>
* Use enumeration in preference to enum when referring to QML API.Andrew den Exter2012-07-061-1/+1
| | | | | | Task-number: QTBUG-24666 Change-Id: I5197d4b4d1a1b53cae2033bd86ce26ba55d08384 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Refresh the TextInput.acceptableInput property when validator changes.Andrew den Exter2012-07-041-0/+18
| | | | | | Task-number: QTBUG-26260 Change-Id: I404640d9a2f000976887dcc2119f971c17a71c7e Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove outdated refactor comments.Andrew den Exter2012-07-031-1/+1
| | | | | | | | | | It's not necessary to check whether the canvas has focus when gaining active focus, as the focus of the root item follows the window focus so an item should never gain active focus if the window doesn't have focus. Change-Id: I8992f673fb64467869d5fb9d23d011f19219feed Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix right aligned cursor position in TextInput with geometry changesPekka Vuorela2012-06-251-1/+1
| | | | | | | | Updating the text layout cannot be omitted with NoWrap because line width needs to be updated even with empty content. Change-Id: Ia9b168d6cfe7680cc1c9e7fa641ce7528d2b6d5e Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Remove the open and closeSofwareInputPanel functions.Andrew den Exter2012-06-221-88/+2
| | | | | | | | | Functionality is provided by the global Qt.application.inputMethod object. Task-number: QTBUG-21449 Change-Id: I75c082bcbe44c8834ccaf966a3f9a09ab91ec290 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Create new documentation structureChris Adams2012-06-211-4/+5
| | | | | | | | | | | | | | | | | | | | The documentation currently has no clear separation between Qt QML and Qt Quick. With recent commits like: 6c8378eaf1edbbefe6aaa3672b0127816a004fd7 and ab1e510121c8a679fdaca12ccd30e0f7ac12a26b the separation between the language definition and implementation, provided by Qt QML, and the standard library for the QML language, provided by Qt Quick, is clear. This commit creates a new documentation structure that is more navigable and separates concepts into logical categories, with clear separation between QtQML and QtQuick. It also provides a more generic QML Application Developer Resources page which contains links to information for QML application developers. Change-Id: Ia807ccfbfd24ffa0e1c7f0a51ed9d2ed3aa6a733 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Doc: Grouped Qt Quick types into several groupsJerome Pasion2012-06-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -created new groups and converted some overviews into group pages -edited type documentation and added \ingroup -articles still need title fixes and link fixes Groups: qtquick-visual-types qtquick-item-graphics qtquick-shaders qtquick-canvas qtquick-text qtquick-text-validator qtquick-interaction qtquick-positioners qtquick-transformations qtquick-states qtquick-animation-define qtquick-animation-properties qtquick-animation-control qtquick-animation-modifiers qtquick-images-sprites qtquick-images qtquick-models qtquick-containers qtquick-views qtquick-paths qtquick-utility Task: QTBUG-25685 Change-Id: I81d4df3320bf5daad5cabb5e42408013fb24f464 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Hide the default cursor if a cursor item is available.Andrew den Exter2012-06-051-1/+1
| | | | | Change-Id: I9ef3350a60ddd355ab588c9cfb3256004ee4493e Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Ensure the cursor delegate position is updated on text changes.Andrew den Exter2012-06-051-3/+3
| | | | | Change-Id: I7518aa5969ea45538feccb87f4c296db6b7d6944 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Update the cursor rectangle when password echo timer expires.Andrew den Exter2012-05-291-0/+1
| | | | | | | | Ensures the cursor is positioned correctly is if the echo mask glyph has a different width to the character it replaced. Change-Id: I924234d4ae29cbb2e61638918005fcc3dc230993 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Doc: Sanitized QML typesNico Vertriest2012-05-241-1/+4
| | | | | | | | | | -modified \brief -checked QML modules -added qml directory to the qdocconf file -added particles directory to the qdocconf file Change-Id: I589e32d3106cda37c7fa4d55a941afd9876fc2b2 Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Defer construction of TextEdit/TextInput delegates.Andrew den Exter2012-05-141-63/+16
| | | | | | | | | | | | | | | 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>
* Ensure the cursor rectangle is updated when preedit text changes.Andrew den Exter2012-05-031-2/+2
| | | | | | | | | Updating only when the cursor position changes isn't enough because changing pre-edit text changes the width of the pre-edit area and the x offset of all cursor positions within it. Change-Id: I3c0a5e4ad4714a903ca84c1a25374491f34d95a0 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* QQuickTextInput aligment to follow input method on neutral contentPekka Vuorela2012-04-271-6/+38
| | | | | | | | | | | | 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-11/+41
| | | | | | | | | | 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>
* Propagate left key presses to the parent item when TextInput is empty.Andrew den Exter2012-04-271-1/+1
| | | | | | | | Don't overwrite the ignore value once it's been set to true. Task-number: QTBUG-25447 Change-Id: I7284147bc525d0971564570f0dd0599cec190905 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Paint TextInput when it is reparentedBea Lam2012-04-201-1/+1
| | | | | | | | | Wasn't being repainted if it was moved off then back into view as part of a VisualItemModel with a ListView. Task-number: QTBUG-24731 Change-Id: I4ba8035709d3e889fb3f0fe82ef0c0523a39ead8 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Compile fix if QT_NO_CLIPBOARD definedAndreas Holzammer2012-04-191-0/+2
| | | | | Change-Id: Ic287a89193c98b2405032fe5859782286d4528d0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Set cursorVisible to false when im cursor length is 0.Andrew den Exter2012-04-021-16/+35
| | | | | | | | | | | | 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-21/+10
| | | | | | | 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-29/+4
| | | | | | | | | 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>
* Add accessibility updates.Frederik Gladhorn2012-03-231-1/+15
| | | | | | | Re-add all accessibility updates with new api. Change-Id: Iec91c41a0137911ccf6e9f4fa907a378d9dd335a Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Fix text wrapping and eliding with implicitWidth.Andrew den Exter2012-03-221-4/+51
| | | | | | | | | | | | 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>
* Don't overwrite text selections made in focus handlers.Andrew den Exter2012-03-211-10/+12
| | | | | | | | | | Defer giving focus to TextInput or TextEdit until after other mouse press handling has been performed, otherwise setting the cursor position will overwrite any selection or cursor position set in the on(Active)FocusChanged handler. Change-Id: I6332642484de65138a444987b5a81be69c6f835f Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Content size should not include trailing spaces.Andrew den Exter2012-03-211-4/+11
| | | | | | | | | | | | | | | Excluding trailing spaces from the content size means the cursor position also needs to considered in determining the width used by the text as unwrapped white space can push the cursor over the width of the item. Also corrects an auto scroll issue with right to left text identified in extending the tests. Task-number: QTBUG-24630 Change-Id: Iaab9eac03824b22f507154fa1d6e55376bd075a0 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Fix unused variable warning.Andrew den Exter2012-03-201-3/+1
| | | | | Change-Id: I5e10bc5e2d42bcbc641ebea8b9bb123479ea857a Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Add additional key sequence tests.Andrew den Exter2012-03-201-4/+2
| | | | | Change-Id: Ie77a61a3ea0d1bdccd59dd519346db74bdf59c44 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Remove all accessibility updates to allow changes in qtbase.Frederik Gladhorn2012-03-141-9/+0
| | | | | | | | In order to integrate pending api changes these are temporarily removed and will return fixed as soon as qtbase is up to date. Change-Id: I558b6049ac3342d41d67441ddfba6821fc370533 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-131-43/+43
| | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I62d203f21df63a95ee236e578b10418fd9680707 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Send accessibility updates for the right item.Frederik Gladhorn2012-03-131-2/+2
| | | | | | | | Child 0 means the first child. The index needs to be -1 which the default ctor does. Change-Id: I71fbdf5a15dd4593178cb250f06d42f601e40d4d Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Remove unused init function.Andrew den Exter2012-03-131-13/+0
| | | | | Change-Id: Id66e177a544fd8e019bae86fff6bd04bd0497d7c Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-23/+19
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
| * Use floating point types for position offsets and cursorRectangle.Andrew den Exter2012-02-241-23/+19
| | | | | | | | | | | | | | | | | | 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-10/+10
|/ | | | | | | | | | | | | 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-44/+17
| | | | | | | | 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>
* Have input method hints on only classes using themPekka Vuorela2012-02-171-5/+9
| | | | | | | | | | | Removed inputMethodHints setter and getter from QQuickItem. No need to consume memory for input method hints on every item when only QQuickTextInput and QQuickTextEdit actually use them. Additionally introduced change signals on the editor hint properties. Change-Id: Ice380d4f4dd47fdde73d2468f4a44a7d1540ad45 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Use QInputMethod instead of deprecated QInputPanelPekka Vuorela2012-02-101-9/+9
| | | | | | | | | | Similarly deprecate Qt.application.inputPanel and introduce replacement Qt.inputMethod. Change-Id: Ie4fd467f93f75023c86b0a2d038d858fe5001146 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Sami Kananoja <sami.kananoja@nokia.com>
* Add linkColor property to Text.Andrew den Exter2012-02-091-1/+1
| | | | | | | | | | | | | | | Allows the color of links in text to be changed from the default blue. This currently only works with StyledText and the distance field rendererer. It could be made to work with RichText overwriting the specified foreground color in all instances or by not setting a default color in the html parser. The former would prevent the color being set with CSS or some future means for altering text formats. The latter would break rendering with QPainter. Task-number: QTBUG-23048 Change-Id: I98df215cabe8a089f648fd4a6206622b4318fb8f Reviewed-by: Martin Jones <martin.jones@nokia.com>