Commit Graph

92 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt ffab396a1d Don't use design metrics with NativeRendering on TextInput
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>
2012-11-09 00:16:09 +01:00
Konstantin Ritt 5c4108e2f0 Fix QQuickTextInput::moveCursorSelection()
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>
2012-10-19 08:58:56 +02:00
Iikka Eklund 46010aa7a2 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-23 08:22:24 +02:00
Bea Lam b2120f6868 Fix uses of various qml doc commands
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>
2012-08-08 04:11:17 +02:00
Andrew den Exter 35c8ad7957 Fix pasting with the middle button in TextInput and TextEdit.
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>
2012-08-06 09:06:24 +02:00
Andrew den Exter 082dff2c8f Add tests for copy and paste using keyboard shortcuts.
Fixes TextInput.cut() removing text while read only.

Change-Id: I03cd44d381be9d53f71ba168b8be7971ab0bbad7
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
2012-08-06 06:04:47 +02:00
Bea Lam 21f6b4d381 Fix various broken links in documentation
Change-Id: I9e2dac37d18e3ca62e4a92be25e5c2e60ffeba00
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-08-03 09:47:47 +02:00
Jerome Pasion 2d3584ff21 Doc: Changed \qmlclass to \qmltype and added \instantiates.
-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>
2012-07-30 11:11:56 +02:00
Andrew den Exter 919b60b4fc Fix restoration of cursor position and selection after undo/redo.
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>
2012-07-24 07:53:05 +02:00
Michael Brasser 19452e126e Update element references to smooth.
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>
2012-07-18 00:49:33 +02:00
Alan Alpert feb996e3ab QQuickCanvas renames
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>
2012-07-17 07:26:15 +02:00
Martin Jones 50ec85e368 Change Quick docs to refer to "types" rather than "elements"
Task-number: QTBUG-24785
Change-Id: I223479b879514abaacb123852323c1cfada7a5e1
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-07-16 04:50:48 +02:00
Andrew den Exter 0142b11269 Use QQuickTextUtil to calculate alignment offsets in TextInput.
Change-Id: I8602f949c01cb4c5a3b05de5a2800dead0ae8b47
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-11 15:52:20 +02:00
Eskil Abrahamsen Blomfeldt b0b4869440 Add option to use native rasterizer for SceneGraph text
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>
2012-07-10 14:22:34 +02:00
Andrew den Exter 9d7ad80186 Use enumeration in preference to enum when referring to QML API.
Task-number: QTBUG-24666
Change-Id: I5197d4b4d1a1b53cae2033bd86ce26ba55d08384
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-07-06 01:51:34 +02:00
Andrew den Exter a1ea8f59e6 Refresh the TextInput.acceptableInput property when validator changes.
Task-number: QTBUG-26260
Change-Id: I404640d9a2f000976887dcc2119f971c17a71c7e
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-04 03:35:18 +02:00
Andrew den Exter db7a351908 Remove outdated refactor comments.
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>
2012-07-03 04:35:06 +02:00
Pekka Vuorela fd754674d0 Fix right aligned cursor position in TextInput with geometry changes
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>
2012-06-25 03:19:10 +02:00
Andrew den Exter 3721de405e Remove the open and closeSofwareInputPanel functions.
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>
2012-06-22 08:18:15 +02:00
Chris Adams 5e33b0f580 Create new documentation structure
The documentation currently has no clear separation between Qt QML
and Qt Quick.  With recent commits like:
6c8378eaf1
and
ab1e510121
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>
2012-06-21 09:58:56 +02:00
Jerome Pasion ca6d49e6b4 Doc: Grouped Qt Quick types into several groups
-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>
2012-06-06 06:27:41 +02:00
Andrew den Exter 5e6d1afb12 Hide the default cursor if a cursor item is available.
Change-Id: I9ef3350a60ddd355ab588c9cfb3256004ee4493e
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-06-05 03:22:18 +02:00
Andrew den Exter 5b83c3c27f Ensure the cursor delegate position is updated on text changes.
Change-Id: I7518aa5969ea45538feccb87f4c296db6b7d6944
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-06-05 03:22:18 +02:00
Andrew den Exter fbc66c4f42 Update the cursor rectangle when password echo timer expires.
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>
2012-05-29 08:54:52 +02:00
Nico Vertriest 6112c0f571 Doc: Sanitized QML types
-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>
2012-05-24 15:41:16 +02:00
Andrew den Exter bd5e23a00e Defer construction of TextEdit/TextInput delegates.
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>
2012-05-14 00:51:15 +02:00
Andrew den Exter bf817782e6 Ensure the cursor rectangle is updated when preedit text changes.
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>
2012-05-03 07:04:03 +02:00
Pekka Vuorela a150d1211f QQuickTextInput aligment to follow input method on neutral content
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>
2012-04-27 13:47:03 +02:00
Andrew den Exter 2a6e105f43 Fix bounding rects of text items.
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>
2012-04-27 06:27:46 +02:00
Andrew den Exter a701746515 Propagate left key presses to the parent item when TextInput is empty.
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>
2012-04-27 03:45:16 +02:00
Bea Lam 8320616dfb Paint TextInput when it is reparented
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>
2012-04-20 06:20:11 +02:00
Andreas Holzammer d4eb0e4531 Compile fix if QT_NO_CLIPBOARD defined
Change-Id: Ic287a89193c98b2405032fe5859782286d4528d0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-19 17:48:29 +02:00
Andrew den Exter 368a3a736c Set cursorVisible to false when im cursor length is 0.
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>
2012-04-02 10:45:55 +02:00
Pekka Vuorela fc1d66130b TextInput to use password mask delay if platform style defines one
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>
2012-03-27 16:03:16 +02:00
Pekka Vuorela f32ae39ac4 Remove tentative commit from editors
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>
2012-03-26 10:36:31 +02:00
Frederik Gladhorn 3d8f103c26 Add accessibility updates.
Re-add all accessibility updates with new api.

Change-Id: Iec91c41a0137911ccf6e9f4fa907a378d9dd335a
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-23 11:47:58 +01:00
Andrew den Exter 336c338c9f Fix text wrapping and eliding with implicitWidth.
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>
2012-03-22 04:06:12 +01:00
Andrew den Exter b6380adcf0 Don't overwrite text selections made in focus handlers.
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>
2012-03-21 06:52:37 +01:00
Andrew den Exter 0e1baa28e5 Content size should not include trailing spaces.
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>
2012-03-21 05:18:35 +01:00
Andrew den Exter d38e9e413c Fix unused variable warning.
Change-Id: I5e10bc5e2d42bcbc641ebea8b9bb123479ea857a
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-03-20 06:49:30 +01:00
Andrew den Exter 7a9cd9d4fe Add additional key sequence tests.
Change-Id: Ie77a61a3ea0d1bdccd59dd519346db74bdf59c44
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-03-20 06:49:30 +01:00
Frederik Gladhorn bfa7648ca4 Remove all accessibility updates to allow changes in qtbase.
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>
2012-03-14 11:39:50 +01:00
Casper van Donderen c291efff26 Remove the usage of deprecated qdoc macros.
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>
2012-03-13 16:34:49 +01:00
Frederik Gladhorn b262e81d52 Send accessibility updates for the right item.
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>
2012-03-13 14:00:45 +01:00
Andrew den Exter c0f032de77 Remove unused init function.
Change-Id: Id66e177a544fd8e019bae86fff6bd04bd0497d7c
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-03-13 14:00:45 +01:00
Matthew Vogt 0284817d6c Merge master <-> api_changes
Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
2012-03-05 11:39:54 +10:00
Matthew Vogt b855240b78 Rename QDeclarative symbols to QQuick and QQml
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>
2012-02-24 04:51:31 +01:00
Andrew den Exter 5fee1e79cc Use floating point types for position offsets and cursorRectangle.
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>
2012-02-24 01:46:49 +01:00
Andrew den Exter d70b27dd68 Reduce the size of QQuickTextInputPrivate.
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>
2012-02-22 01:23:49 +01:00
Pekka Vuorela c79f36c51f Have input method hints on only classes using them
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>
2012-02-17 04:28:49 +01:00