aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qquicktextinput
Commit message (Collapse)AuthorAgeFilesLines
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-2434-5062/+0
| | | | | | | | | | | | | 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>
* Have input method hints on only classes using themPekka Vuorela2012-02-171-4/+16
| | | | | | | | | | | 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>
* Fix access to context properties within TextEdit.cursorDelegateAndrew den Exter2012-02-144-1/+46
| | | | | | | | | | Don't create the cursorDelegate instance before componentComplete as the context may not be fully populated prior to that. Task-number: QTBUG-21780 Change-Id: I6ca8a24989bc28e5c5ca06d61a85e32ff630ce7c Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Use QInputMethod instead of deprecated QInputPanelPekka Vuorela2012-02-101-35/+35
| | | | | | | | | | 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>
* Don't crash if focus issues arise.Alan Alpert2012-02-091-0/+2
| | | | | | | | The test has some strict focus requirements, but if they are not met then the test should FAIL with a bit of explanation instead of crash. Change-Id: I796e8a8092833f3413b3dc98a22466575dfe241d Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Add contentWidth and contentHeight properties to Text elements.Andrew den Exter2012-02-071-0/+29
| | | | | | | | | | | For Text and TextEdit this is a rename of paintedWidth and paintedHeight both of which remain as synonyms of the content properties for compatability. For TextInput this is a new property. Task-number: QTBUG-23691 Task-number: QTBUG-15160 Change-Id: Idbdc72fad34922be21b649ca45fc39b5e533ed1a Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Fix vertical offset of TextInput.positionToRectangle.Andrew den Exter2012-02-061-1/+53
| | | | | | | | | Offset the y value of the rectangle by the vertical scroll and line offset. Task-number: QTBUG-23934 Change-Id: I43815b480f43a089a9a03b0aec32dfc0598b6154 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove QtQuick1 elements from qtdeclarativeMatthew Vogt2012-02-031-45/+0
| | | | | | | | QtQuick1 is now contained in a separate repository. Task-number: QTBUG-23737 Change-Id: I09eae67af5693a22b896b916f816f73ccc3a89b1 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Adapt to QGuiApplication::focusObject() for notifying input methodPekka Vuorela2012-02-021-31/+25
| | | | | | | | | Emitting focusObjectChanged() signal now instead of explicitly setting inputItem to QInputPanel. Also adapted from deprecated QInputPanel::inputItem() to QGuiApplication::focusObject(). Change-Id: I97460625cc8bb2820ec7716a06330aecd1b585ea Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Add a persistentSelection property to TextInput.Andrew den Exter2012-02-022-0/+53
| | | | | | | | Improves feature parity with TextEdit. Task-number: QTBUG-16355 Change-Id: I3919c71454a4f4574a1ee35ad38969459beb8363 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Enhance editors notifying input panel for input method changesPekka Vuorela2012-01-271-2/+28
| | | | | | | | | | | Introduced protected QQuickItem::updateInputMethod() and removed similar, but badly named updateMicroFocus(). Added some missing notifications from the editors and avoided unnecessary updates when not having focus. Change-Id: Id5c00e87dc26fd35c3f919006817511d4ed6418d Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Add a locale property to IntValidator and DoubleValidator.Andrew den Exter2012-01-251-0/+95
| | | | | | | | | Allow the locale used for interpreting numbers to be changed from the application default. Task-number: QTBUG-23713 Change-Id: I28463485c86236fb2586eeb703ec4b051405c5a8 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update TextInput.acceptableInput on component complete.Andrew den Exter2012-01-202-2/+87
| | | | | | | | | | | | QValidator doesn't notify when it's validation criteria changes so is susceptible to order of evaluation issues. Deferring the initial validation will ensure validators with static criteria are correctly applied. Notification from QValidator on changes would solve this for all cases: QTBUG-23694. Task-number: QTBUG-21103 Change-Id: I920f36645fd18ce809db56b5daf73545f1d603dc Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Made QQuickTextInput follow input direction changesPekka Vuorela2012-01-171-16/+36
| | | | | | | | | | | | | Cursor of empty field should align based on input method direction. Now input method allowed to change direction on run time. Also earlier cursor wasn't properly drawn on correct alignment at all. Change-Id: I4601f10e6b5dde09591bd484b05f001add6c1573 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Use QGuiApplication, not QApplication, in testsDamian Jansen2012-01-131-5/+5
| | | | | Change-Id: I7802293e6cafb90686c103972bc036cf74184714 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Adapt to QInputPanel::inputDirection() APIPekka Vuorela2012-01-121-4/+4
| | | | | | | Information moved from QGuiApplication into QInputPanel. Change-Id: Idd80609f4b67bffae7222a1fa27918724ebf60f6 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Fix validators not allowing backspace or delete.Andrew den Exter2012-01-121-0/+41
| | | | | | | | | | TextInput will allow non-valid changes to already invalid text, when a validator is changed update the current validity so changes can be made to bring the text back to a valid state. Task-number: QTBUG-22080 Change-Id: I501961b473f58c317bce474b1df8d91fd1f967d4 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add undo and redo functions to TextInput and TextEdit.Andrew den Exter2012-01-121-5/+32
| | | | | | | | | The functionality already existed and was usable through keyboard short cuts but was not accessible through API. Task-number: QTBUG-16191 Change-Id: I080fa2ddb76668a7a632aa7477004f99037ea68b Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix failing tst_qquicktextinput::horizontalAlignment_RightToLeft test.Andrew den Exter2012-01-121-19/+25
| | | | | | | | | | How the text is laid out is dependent on the horizontalAlignment so that needs to be determined before updating the display text and doing the layout. Task-number: QTBUG-23485 Change-Id: I1872b1bfc60fd829a0d69c21a19cd3b2b4dc8340 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Skip failing autotestsAaron Kennedy2012-01-051-3/+6
| | | | | | Task-number: QTBUG-23485 Change-Id: If2676717e3e18f256e621b30cab8f12e39c5d3d9 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* QQuickTextInput to better call QInputPanel::update()Pekka Vuorela2012-01-051-0/+68
| | | | | | | | | | Some updates were previously omitted, e.g. if text content changed but cursor position remained the same, or if input method changed the selection. Change-Id: I11abd105632d73f8ebb23d0e8c308c53c236cc15 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix clipping of TextInput contents.Andrew den Exter2012-01-051-16/+52
| | | | | | | | | | | | The boundingRect represents the clip rectangle of an item rather than the size and position of its unclipped content. This would prevent any content from being clipped except the boundingRect is only re-evaluated when the size of the item changes so the content is instead clipped to the size of the original content. Task-number: QTBUG-23422 Change-Id: I96f830f833129b3230f65452db67b00028c40d6a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add length property and insert, remove and getText functions to TextInput.Andrew den Exter2012-01-041-0/+797
| | | | | | | | These mimic the functionality of their pre-existing counterparts in TextEdit. Change-Id: Idcb7549cd07ed3c287ab00b7828a3158690faf0e Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix crash in TextInput.Andrew den Exter2012-01-042-0/+34
| | | | | | | | | Ensure the text is laid out before calling componentComplete() on QImplicitSizeItem, as that can potentially evaluate bindings which would then access the uninitialized layout. Change-Id: I5152c1494c54209dae61c13b2f45d343fb76bf9e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Combined platform input contexts in tests into one sharedPekka Vuorela2012-01-031-35/+1
| | | | | Change-Id: Ie56f5f8ca5617db6be92d256d455cae585cd6a71 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Use Qt::ImhSensitiveData input hint on TextInput with password echo modePekka Vuorela2012-01-031-4/+4
| | | | | Change-Id: I1e9255af24b51ca42c1e6df7a92664be532ce725 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Fix test failures with shadow builds.Andrew den Exter2012-01-031-3/+3
| | | | | | | | | | QFINDTESTDATA uses __FILE__ to determine the source directory, which means it finds the wrong source directory when the macro is used from a shared base class. Define the correct source directory in a pri file and include that wherever QDeclarativeDataTest is used. Change-Id: If3ef435f4bb3049733f49402338303c8b440f1fa Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* QDeclarative tests: Introduce base class for data tests.Friedemann Kleint2011-12-212-42/+34
| | | | | | | | | | | | | | | | | In tests/auto/shared/util.* replace macros/find functions by a base class QDeclarativeDataTest with accessors for the data directory helper functions to create URLs from it. The class relies on QFINDTESTDATA, which is the standard way of locating test data. Using the class should reduce the number of calls to QFileInfo.exists(), etc significantly. In addition, provide utility functions for messages. Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Change-Id: Id2beacb157922ee9412f9e45cf9695cec1f8379a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove uneccessary layout in TextInput initialization.Andrew den Exter2011-12-211-0/+5
| | | | | | | | | | The layout was only done to ensure there was always at least one QTextLine in the layout to avoid validity checks later, but since lineForTextPosition can return an invalid QTextLine the checks are still needed anyway. Change-Id: Iae65e3460812a60e2aafecd553bf4241bd640d04 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* QQuickLineControl more robust on input method & selection statePekka Vuorela2011-12-201-0/+8
| | | | | | | | | | | | | Input method event having replacement information out of bounds left the controller in selection state when it shouldn't be. Also now more liberal on accepted events. We cannot detect if input method is confused for replacement inside boundaries, but going beyond the end is more likely to be meant to replace until the end than to leave previous text in addition to the new one. Change-Id: I485009ac682c11876b39f7e22d7dfb91a6d162fe Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Delay masking the last character in Password echo mode.Andrew den Exter2011-12-201-5/+11
| | | | | | | | | | | | | | | If QT_GUI_PASSWORD_ECHO_DELAY is defined in qplatformdefs.h with an integer value in milliseconds, QLineEdit and TextInput will display the last character entered unmasked for that delay period and then mask the character as normal. If QT_GUI_PASSWORD_ECHO_DELAY is not defined then the behaviour is unchanged. Task-number: QTBUG-17003 Task-number: QTBUG-20719 (cherry picked from commit f9e7aee2019d321edd655bfde7de43f20a106971) Change-Id: I9a8647a0adeb94fc6beea949cdce7336671c898e Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add wrapMode and verticalAlignment properties to TextInput.Andrew den Exter2011-12-203-35/+161
| | | | | | | | | | | | Wrap mode provides an alternative to horizontal scrolling when the width of the text exceeds the width of the TextInput. With auto scroll wrapping introdoces an implicit verticalAlignment so support setting it explicitly as well. Task-number: QTBUG-22305 Task-number: QTBUG-16203 Change-Id: I1bd3a5335edb3ac48df3d5ccd8ae7274caa91883 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Merge QQuickLineControl into QQuickTextInput.Andrew den Exter2011-12-161-4/+2
| | | | | | | | | | There's no clear separation of responsibilty between these classes and keeping them in sync and forwarding signals is a unnecessary overhead that can be avoided by combining them. Task-number: QTBUG-22627 Change-Id: I4350eb3c612b10d4ed34886374889ae893b8183a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Create a copy of QLineControl in the QtDeclarative library.Andrew den Exter2011-12-121-2/+2
| | | | | | | | | | First half of a move of QLineControl from qtbase to qtdeclarative, some time in the future QLineControl will be deleted from qtbase to finish the move. Task-number: QTBUG-22627 Change-Id: I0c3449f57f1a3296a0ff52f2b9a1a78041ae28b2 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Fix test failures due to invalid font metrics.Andrew den Exter2011-12-051-74/+66
| | | | | | | | | | | Don't use QFontMetrics to determine expected text dimensions or cursor positions in TextInput and TextEdit tests. Instead Layout the text with the same options as used by the item so the only error should be due to error. Task-number: QTBUG-21689 Change-Id: I7ba008d92f1ebb14c37ae7df06fdb11465c3225d Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Test fixes for OS X.Michael Brasser2011-12-051-13/+9
| | | | | Change-Id: Idee212db1ee267d44463886de6a7918404ba549d Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-0229-0/+3593
This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>