aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fixed wrong baseline alignment for TextInputJan Arve Saether2014-02-121-0/+12
| | | | | | | | [ChangeLog][QtQuick][Fixed wrong baseline alignment for TextInput] Task-number: QTBUG-36749 Change-Id: I6920fb0681f30d9e9943d1bd01f76cc3ae204f30 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Allow renderType: Text.NativeRendering on retina displays/devicesTor Arne Vestbø2014-01-271-4/+1
| | | | | | | | | | | | | Setting the renderType to Text.NativeRendering might be needed in some cases where distance-field does not produce the expected results, such as for emoji characters or really large fonts. These use cases are valid on retina displays as well, so having the setter second-guess the request from the user to use native rendering is not ideal. Change-Id: I7c6049766e60574487c29de07fbd5c100ec69a2a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fix QQuickTextInput not overriding shortcuts (del/home...)Frederik Gladhorn2013-12-021-0/+2
| | | | | | | | | | | | [ChangeLog][QtQuick] QQuickTextInput would not accept delete/home/backspace/left/right keys when the key was used in a shortcut. Task-number: QTBUG-34517 Change-Id: I553af8247191ecdadcb4677e9fc85848270a95d3 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* TextInput: call fixup() when appropriateJ-P Nurmi2013-11-271-2/+2
| | | | | | | | | | [ChangeLog][QtQuick] Fixed TextInput to call fixup() on its validator when being accepted or losing focus, and the validator reports that the input is in "intermediate" state ie. the input should be fixed up. Task-number: QTBUG-35128 Change-Id: I4b15406c584a9647bcf892badfaf6d845868fbf1 Reviewed-by: Liang Qi <liang.qi@digia.com>
* Fix build with QT_NO_ACCESSIBILITYThomas McGuire2013-11-261-1/+1
| | | | | | | "q" was an unused variable, which triggered a warning/error. Change-Id: I83bdc63a7caa12a5cd48331729492c0f36ed6fa0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* TextInput: add editingFinished signalLiang Qi2013-11-221-0/+15
| | | | | | | | | | | | | | | Autotest is included. Task-number: QTBUG-34780 [ChangeLog][QtDeclarative][TextInput] add editingFinished signal Change-Id: Ib633daee67cd4e5f15739a6004adbe882ab3d3fc Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-1/+1
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-76/+76
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@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>
* Fix QQmlV4Function API to be GC safeLars Knoll2013-09-261-5/+6
| | | | | Change-Id: Id4f79c22fc48ada1c8a9a858e1b7b3d1cf14d120 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-251-4/+4
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Merge branch 'stable' into devSergio Ahumada2013-09-191-2/+2
|\ | | | | | | | | | | | | | | Conflicts: src/qml/qml/v8/qqmlbuiltinfunctions.cpp tests/auto/qml/qml.pro Change-Id: Ib373aed6a8f8df9521740fb5b080daed38546cd2
| * Doc: Move properties of Locale QML type to correct moduleTopi Reinio2013-09-171-2/+2
| | | | | | | | | | | | | | | | | | Moves property and method documentation for QML Locale type from Qt Quick to Qt Qml module, and fix a number of broken links in locale-related docs. Change-Id: Id9e01314ea867987f5159ca3bffcc40abb27b289 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Add support for external drag and drop in Quick items.Chris Meyer2013-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dragType enums with values of None, Automatic, Internal (default). Setting to Automatic allows startDrag to be called automatically. Setting to Internal (default) retains old behavior. Add mimeData to Drag item to enable external drags. Call startDrag to start drag manually or change from internal drag to external drag. Added events dragStarted and dragFinished that get invoked from startDrag. Mime data must be specified in the mimeData property as mime-type / data pairs. Moved QQuickDrag from qquickmousearea* files to qquickdrag* files to reduce header interdependencies that caused linking errors in other modules and also to improve code organization. Allow DropArea to receive and process external data. Introduced new variable containsDrag to QQuickDropAreaPrivate. This replaces mimeData which was previously being used to determine if a drop operation was currently occurring. The problem was that mimeData was being externally destructed. Also introduced accessor methods for getting color, html, image, text, and urls out of the drop. This facilitates dropping of external data of those types onto a DropArea. Added example quick/externaldraganddrop. Task-number: QTBUG-27498 Change-Id: I1420df7c161ea3399e49a23305273e106baa246f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Document TextInput property displayText as read-onlyJeremy Katz2013-09-081-0/+2
| | | | | | | | | | | | Change-Id: Iff30a548fc2ef8ecf2fa6393832943f365cb0fa3 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Remove variables that aren't being used right nowThiago Macieira2013-09-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Found by ICC. src/quick/items/qquicktextcontrol.cpp(78): error #2415: variable "fullWidthSelection" of static storage duration was declared but never referenced src/quick/items/qquicktextinput.cpp(2696): error #2415: variable "textCursorWidth" of static storage duration was declared but never referenced src/quick/items/qquicktextinput.cpp(2697): error #2415: variable "fullWidthSelection" of static storage duration was declared but never referenced src/quick/scenegraph/qsgthreadedrenderloop.cpp(164): error #2415: variable "WM_LockAndSync" of static storage duration was declared but never referenced src/quick/scenegraph/qsgthreadedrenderloop.cpp(181): error #2415: variable "WM_UpdateLater" of static storage duration was declared but never referenced Change-Id: I60b5cce79d7be5f909b690f97ffa93ea00d3c044 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-241-9/+18
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
| * Disable native glyph rendering on embeddedGunnar Sletta2013-04-251-1/+2
| | | | | | | | | | Change-Id: I71769affe8f0138dd65f3b94fb27176bd069ab8d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * Use the platform theme's password mask character for text input fields.Mitch Curtis2013-04-231-3/+5
| | | | | | | | | | | | | | | | Task-number: QTBUG-29871 Change-Id: I3b15dfab5ca6455df465c502c93aac7b85a64531 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
| * TextInput: Fix cursor navigation with maskFrederik Gladhorn2013-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | text().length() was used to check if a cursor movement to the right was valid. The problem is that with a mask and not text set yet (inputMask: "#0:00;*") pressing the right arrow would not move the cursor. The input and other functions use the actual d->m_text since that includes the mask length. Task-number: QTBUG-30740 Change-Id: Ic225778e5a49d80b754b63d0eb4a438eaa9818e2 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * TextInput: Fix cursor heightGabriel de Dietrich2013-04-161-4/+10
| | | | | | | | | | | | | | | | | | | | | | On many platforms, the current cursor looks too tall. The logic used in this patch is inspired by what we have in QTextLayout::drawCursor(). It still looks too tall on Mac, but so it does in Qt Widgets. QQuickTextInput::positionToRectangle() has also been updated for consistency. Change-Id: I69b8ad246238d54db370db639a319a3edba6d78a Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Remove v8 usage in a few placesLars Knoll2013-06-061-4/+4
| | | | | | | | | | Change-Id: Ib9885d395dd799c0f9dc68e16efea44b60cb1418 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup v8 dependencies from QQmlV8FunctionLars Knoll2013-05-081-5/+5
| | | | | | | | | | | | | | ... and rename it to QQmlV4Function Change-Id: Iad72347babf62691e26306877d4f229fda127eb7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::LocalLars Knoll2013-05-061-1/+1
| | | | | | | | | | | | | | | | | | The class was doing exactly the same thing as v8::Handle in our implementation. Removing it cleans up quite a bit of code. Change-Id: I37a3dcdef062fc388751e9ef0a158b5926ba2efb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup lots of V8 dependencies in QJS* classesLars Knoll2013-04-181-0/+1
|/ | | | | | | | | | | Implement a good part of QJSValue using V4. Keep the QV8Engine for now (as it is used everywhere), but add an ExecutionEngine pointer to it so other parts can more easily be ported to V4. Remove a lot of other stuff that's not required anymore. Change-Id: Ibe2c9ab10f0ee977e0e3d05a42f526206d7b22b5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use distance fields for text on retina displaysGunnar Sletta2013-04-021-1/+3
| | | | | Change-Id: I6d3f3e7e4813155f2abb3edc51b145fb709c485b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* TextInput: Update text deselection on focus out eventCaroline Chao2013-03-071-1/+4
| | | | | | | | | | | | | | | The text selection should not be cleared when the focus out event received has one the following reasons: - Qt::ActiveWindowFocusReason - Qt::PopupFocusReason When the user opens a menu or navigates to another window, the eventual selection should not be clearer. This also makes the behavior consistent with TextEdit. Change-Id: Ibc6242cb2f8207cf5281925c8e20b88394f21eea Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* TextInput: Handle focus event directlyCaroline Chao2013-03-071-25/+29
| | | | | | | | | 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>
* Enablers for input methods on AndroidPaul Olav Tvete2013-03-041-1/+1
| | | | | | Change-Id: Ic26722cf530e7a787e7a8f92b645e3c4883d9822 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix missing TextInput::remove(int start, int end) docsJ-P Nurmi2013-02-151-1/+1
| | | | | Change-Id: I0c98e713d53391a191435e5c17b58becddf6d451 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Ensure the cursorRectangle is updated as the width of the text changes.Andrew den Exter2013-02-011-1/+3
| | | | | | | | | | Outside of when of a monospace font is used, if the text changes the visual position of the cursor will have most likely changed as well even when the cursor index hasn't. Task-number: QTBUG-28677 Change-Id: If8077772d8541a677d5875976e6cd9fc453731df Reviewed-by: Alan Alpert <aalpert@rim.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>
* Accessibility: Improve interface handling in QuickFrederik Gladhorn2012-12-191-5/+12
| | | | | | | | | | | | | | | | | | This changes how interfaces are handled: the QAccessibleQuickItem will simply subclass all interfaces and dynamically return 0 or the appropriate interface_cast. This makes our implementation a lot more flexible. To make use of the value interface, only a value property is needed (together with a corresponding role). Since the implementation of the interfaces became simpler, the value interface and some text interface improvements go along with the change. Change-Id: I003ec3016d48d730a4acac467bce322167842f4d Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Renamed QQuickItem::pos property to positionShawn Rutledge2012-11-291-1/+1
| | | | | | | | | Abbreviated property names are less descriptive so we don't have many of them. Might as well be consistent. QWindow::pos was already renamed. Change-Id: Ib52673e68e7dc902b2f8942dba6b899074b2538b Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Enable module build with QT_NO_IMTasuku Suzuki2012-11-261-6/+100
| | | | | | Change-Id: I90f8ec7e6357db7b4038bb1646fe9d3835821556 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
* Don't use design metrics with NativeRendering on TextInputEskil Abrahamsen Blomfeldt2012-11-091-0/+3
| | | | | | | | | | We only set the design metrics property in init(), before the renderType has been set. Since updateLayout() is called every time the renderType changes, it should be sufficient to set it there. Change-Id: If5b2cb3738e8135195848857a30f4e646bdf1d0b Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix QQuickTextInput::moveCursorSelection()Konstantin Ritt2012-10-191-5/+4
| | | | | | | | | | | by using fixed QTextBoundaryFinder behavior. Update QQuickTextInput autotests. Task-number: QTBUG-11365 Change-Id: I81761c019e2fe80c9795fe54a2a990bfc5d4b709 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.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 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>