11 years agoAllow enum values to be used as signal parameters
Bea Lam [Tue, 5 Apr 2011 06:55:18 +0000 (16:55 +1000)]
Allow enum values to be used as signal parameters

The fix does not work for enums declared outside of the class that
emits the signal, since in this case it is not possible to access
the metaobject of the class that declared the enum. However the
fix makes a special case for the Qt namespace to allow enums in this
namespace to be used.

Task-number: QTBUG-15983
Change-Id: I6f72255b07010311a20fe068bd97c7db7b294d9b
Reviewed-by: Aaron Kennedy
11 years agoListModel::clear() should not clear roles
Bea Lam [Fri, 8 Apr 2011 04:20:17 +0000 (14:20 +1000)]
ListModel::clear() should not clear roles

Clearing a model and then appending a new object with a subset of the
previous roles was causing a crash since ListModel cleared the roles
and VisualDataModel did not, so VisualDataModel was requesting invalid
roles. This could have been fixed by clearing the meta object and
its property cache in in VisualDataModel but this is less efficient,
and also the general use case is for model data to always have the same

Task-number: QTBUG-18587
Change-Id: Ib11d2292888ab7a41e772b1e11700cd665e94ae7
Reviewed-by: Michael Brasser
11 years agoImage w/ PreserveAspectFit has its width changed once more than needed.
Martin Jones [Wed, 6 Apr 2011 05:46:35 +0000 (15:46 +1000)]
Image w/ PreserveAspectFit has its width changed once more than needed.

Avoid an extra setImplicitWidth/setImplicitHeight on image load.

Change-Id: I8bec1c97244068000c7a7f5fb3e937f80f3b36f5
Task-number: QTBUG-18573
Reviewed-by: Michael Brasser
11 years agoQmlViewer: Enable remote qml debugging
Kai Koehne [Wed, 6 Apr 2011 10:41:05 +0000 (12:41 +0200)]
QmlViewer: Enable remote qml debugging

Allow users to use qmlviewer for profiling.

Change-Id: I4bddabceade17260159ff5b46b35072afb204ff6
Task-number: QTBUG-18595
Reviewed-by: Christiaan Janssen
11 years agoQDeclarativeDebug: Warn user for Qt configured with -no-declarative-debug
Kai Koehne [Tue, 5 Apr 2011 14:39:52 +0000 (16:39 +0200)]
QDeclarativeDebug: Warn user for Qt configured with -no-declarative-debug

Print a warning if the user passes -qmljsdebugger on command line, but
Qt is configured with -no-declarative-debug

Change-Id: I72c9ffad9631ffe8582c13e3a4e798b102d0efad
Reviewed-by: Christiaan Janssen
11 years agoImprove Flickable dynamics and allow platform specific tweaking.
Martin Jones [Wed, 6 Apr 2011 04:51:52 +0000 (14:51 +1000)]
Improve Flickable dynamics and allow platform specific tweaking.

Flickable's previous overshoot behavior was to continue past the
boundary without any additional friction (deceleration). It now
decelerates faster when overshooting.

On touch screens in particular, the last points when a touch point
is released are unreliable, resulting in sporadic flick velocities.
It also now allows the number of samples used for velocity calclations
to be tuned.

It is now easy to tune the Flickable behavior for different platforms.

Change-Id: I24142a50be1fde2f8877e359e30b8efcdd1f7d5c
Task-number: QTBUG-10894, QTBUG-16388, QTBUG-17830
Reviewed-by: Michael Brasser
11 years agoFix failing autotest
Bea Lam [Mon, 4 Apr 2011 05:21:59 +0000 (15:21 +1000)]
Fix failing autotest

Caused by 4391e2a1c35a53cc5f116926a1e5177e9ee4f51e

11 years agoXmlListModel should allow types other than application/xml
Bea Lam [Mon, 4 Apr 2011 00:17:51 +0000 (10:17 +1000)]
XmlListModel should allow types other than application/xml

application/xml is the most appropriate content type but some servers
may use other types, e.g. text/xml, so allow */* as a fallback.

Task-number: QTBUG-18005
Change-Id: I0442148233e06aacb2cbfaaf7ae624ba733d5f9a
Reviewed-by: Michael Brasser
11 years agoDocument using Behaviors with States.
Michael Brasser [Fri, 1 Apr 2011 02:53:05 +0000 (12:53 +1000)]
Document using Behaviors with States.

Change-Id: I74f163cef8caa16cccb158061ec30ffb4e471fd1
Task-number: QTBUG-16856
Reviewed-by: Bea Lam
11 years agoAdd missing test file.
Martin Jones [Fri, 1 Apr 2011 03:07:31 +0000 (13:07 +1000)]
Add missing test file.

Missing from ea304fb207b681ee084c4ce9bc61d1dd847bd7b0

Change-Id: If69b16fe71c69c174968868afed5647d6ea414a8
Task-number: QTBUG-17829

11 years agoChanging width of RTL positioner doesn't relayout
Martin Jones [Fri, 1 Apr 2011 00:36:49 +0000 (10:36 +1000)]
Changing width of RTL positioner doesn't relayout

If the width of the layout changes then the items must be laid out

Change-Id: I2b97bd45d07842fd3da2a0637391473ed6d78aa8
Task-number: QTBUG-18501
Reviewed-by: Michael Brasser
11 years agoFix TextInput auto test failure on mac.
Andrew den Exter [Thu, 31 Mar 2011 06:46:02 +0000 (16:46 +1000)]
Fix TextInput auto test failure on mac.

Allow for some error due to additional padding on mac.

Change-Id: Iee9ce8eb9c4cec2f96c22340162f628ffcbd44d1
Reviewed-by: Bea Lam
11 years agoPinchArea and Flickable don't work well enough together
Martin Jones [Thu, 31 Mar 2011 23:29:38 +0000 (09:29 +1000)]
PinchArea and Flickable don't work well enough together

Allow PinchArea to be more aggressive in grabbing the gesture and
keep the gesture until all touches are released.

Change-Id: Ic80b7c4c478e1ee3b1c3da0772553756d9d5473f
Task-number: QTBUG-17829
Reviewed-by: Bea Lam
11 years agoFix auto test failure.
Andrew den Exter [Thu, 31 Mar 2011 06:22:04 +0000 (16:22 +1000)]
Fix auto test failure.

Add test file ommited from b94176e69efc3948696c6774d5a228fc753b5b29.

Change-Id: Ia5436974a4941f50c8f1636196372e5b8a90be5f

11 years agoOnce Image sourceSize is set there is no way to clear it.
Martin Jones [Thu, 31 Mar 2011 00:32:26 +0000 (10:32 +1000)]
Once Image sourceSize is set there is no way to clear it.

Image sourceSize lacked a RESET method to allow reverting to the
natural size of the image.

Change-Id: I4e9089d8e16991375745db553f891bd377143eab
Task-number: QTBUG-18442
Reviewed-by: Yann Bodson
11 years agoRotation transform with NaN angle can cause crash
Martin Jones [Wed, 30 Mar 2011 23:08:03 +0000 (09:08 +1000)]
Rotation transform with NaN angle can cause crash

When used in conjunction with Text resulted in massive memory

Change-Id: I5e19cb54bcd57b1ea32d17641f976f8288611a9e
Task-number: QTBUG-18386
Reviewed-by: Charles Yin
11 years agoCanceling image download while reading causes crash
Martin Jones [Wed, 30 Mar 2011 04:09:56 +0000 (14:09 +1000)]
Canceling image download while reading causes crash

We were deleting a QObject owned by another thread, which is fine if
there are no pending events, but very bad if there are, e.g.
queued signals due to downloadProgress() updates.  Use deleteLater()
which is safe to call in any thread.
Also call QDeclarativePixmap::clear(QObject *obj) where appropriate
to remove connections and ensure we don't handle any unwanted signals
after the download is cancelled.

Change-Id: Ia8fb41a8cd004d9840e7cec35915f1afdb03ac4d
Task-number: QTBUG-18412
Reviewed-by: Aaron Kennedy
11 years agoFix width of TextInput micro focus rectangle.
Andrew den Exter [Fri, 25 Mar 2011 05:28:40 +0000 (15:28 +1000)]
Fix width of TextInput micro focus rectangle.

Remove the padding QLineControl::cursorRect() adds for region updates.
QGraphicsView also grew the rectangle by returning the bounding rect
of the transformed rectangle which is fixed by using the same transform
for QRect as is used for QRectF.

Change-Id: I8d8df9dbc6b4250e4e5392871191123a76b304a0
Task-number: QTBUG-18343
Reviewed-by: Martin Jones
11 years agoReturn correct boundaries reasons from QTextBoundaryFinder.
Andrew den Exter [Thu, 3 Mar 2011 05:20:17 +0000 (15:20 +1000)]
Return correct boundaries reasons from QTextBoundaryFinder.

The next character after a boundary is at pos, not pos + 1.  Also
consider whether the previous and next character are whitespace in
combination when determing word boudaries otherwise positions between
whitespace characters will return both StartWord and EndWord.

And since there's no need to look ahead one character don't shortcut`
the regular logic for the boundary before the last character.

Change-Id: I2efbf3947066767945f96bf8456ef518d2149191
Task-number: QTBUG-11365
Reviewed-by: Denis Dzyubenko
Reviewed-by: Ritt Konstantin
11 years agoGridView jumps to beginning of list when resized
Martin Jones [Tue, 29 Mar 2011 22:57:32 +0000 (08:57 +1000)]
GridView jumps to beginning of list when resized

Introduced by RTL changes.  The list position should only be reset when
the view is completely regenerated, e.g. when the orientation changes.

Change-Id: I748333529c113d95eaebfb8ac9bb9cf543413d3b
Task-number: QTBUG-18441
Reviewed-by: Bea Lam
11 years agoFix text selection with shift-click.
Andrew den Exter [Mon, 28 Mar 2011 01:33:58 +0000 (11:33 +1000)]
Fix text selection with shift-click.

Move the cursor when word selection is NOT enabled.  If word selection
is enabled then then cursor would have been moved in a previous branch,
the (incorrectly inverted) check was to prevent that being overridden.

Change-Id: I788c3b41c6fdb250d6086893ea98a1aa8c302514
Task-number: QTBUG-18017
Reviewed-by: Alan Alpert
11 years agoFix QUnifiedTimer bug
Alan Alpert [Thu, 24 Mar 2011 23:37:46 +0000 (09:37 +1000)]
Fix QUnifiedTimer bug

Pause animations (like Timer) could trigger a jump to the next tick,
which meant that other pause animations would have missed the interval
skipped by the pause.

Change-Id: Idebe4cbe70b2a1536d684288fc1c5d65e4c5df84
Cherry-pick-of: 0f5feed7dc260eabe1c2784a168e0b2fcc85e1d8
Task-number: QTBUG-18126
Reviewed-by: Leo Cunha
Reviewed-by: Michael Brasser
11 years agoFix memory leak.
Martin Jones [Thu, 24 Mar 2011 03:36:57 +0000 (13:36 +1000)]
Fix memory leak.

Change-Id: I919935399ee1b0e505c85781d481d17345df25c9
Task-number: QT-4330
Reviewed-by: Michael Brasser
11 years agoText bounding rect calculated incorrectly if non-top aligned.
Martin Jones [Mon, 21 Mar 2011 06:27:45 +0000 (16:27 +1000)]
Text bounding rect calculated incorrectly if non-top aligned.

QRect::setY() affects the size of the rectangle, so the height of
the bounding rect was too small.  Use moveTop() instead, which does
not affect the size of the rectangle.

Change-Id: If41ba6a28c9a7370f054dab20995a198f822ae2b
Task-number: QTBUG-18194
Reviewed-by: Bea Lam
11 years agoFix writing to an attached property from script.
Michael Brasser [Mon, 21 Mar 2011 02:25:47 +0000 (12:25 +1000)]
Fix writing to an attached property from script.

Change-Id: I80c228092271d4d9c5694607da7a123d06739731
Reviewed-by: Aaron Kennedy
11 years agofixes/improvements for new QML right-to-left docs
Bea Lam [Mon, 21 Mar 2011 03:20:36 +0000 (13:20 +1000)]
fixes/improvements for new QML right-to-left docs

Clarify some of the docs and fix some broken doc links.

11 years agoFix license headers in example code
Bea Lam [Mon, 21 Mar 2011 00:28:29 +0000 (10:28 +1000)]
Fix license headers in example code

Change-Id: I510caf92c2e33df2bb44d87cc07fe78a0823ab5f

11 years agoWrite Qt Quick 1.1 right-to-left documentation and examples
Joona Petrell [Mon, 14 Mar 2011 06:45:15 +0000 (16:45 +1000)]
Write Qt Quick 1.1 right-to-left documentation and examples

Task-number: QTBUG-11042
Reviewed-by: Martin Jones
Change-Id: I6319992dec52a4d9252c2df39801ebe6a7dee75d

11 years agoDoc fix - QtQuick 1.1 scheduling
Bea Lam [Fri, 18 Mar 2011 06:16:56 +0000 (16:16 +1000)]
Doc fix - QtQuick 1.1 scheduling

Change-Id: If19934bf378e5fbc6cb1dce1df2164905e97f0ed

11 years agoPathView doesn't update if preferred highlight range changes.
Martin Jones [Thu, 17 Mar 2011 08:01:50 +0000 (18:01 +1000)]
PathView doesn't update if preferred highlight range changes.

Simply call refill() when they change.

Change-Id: I45ab56cbcaf5c726ce4c4f23f66ee687a6d89dad
Task-number: QTBUG-15356
Reviewed-by: Kevin Wu Won
11 years agoImage.PreserveAspectFit has unexpected effect on Image's sourceSize
Martin Jones [Thu, 17 Mar 2011 07:10:56 +0000 (17:10 +1000)]
Image.PreserveAspectFit has unexpected effect on Image's sourceSize

The sourceSize should always be the size of the image, unless set
otherwise.  When calculating the size of an image with
Image.PreserveAspectFit set the natural image size should be used
for the calculation if no size has been set explicitly.

Change-Id: I104b7d1c3c16aa5b4fc98b1f9078ed8ae997cf69
Task-number: QTBUG-16389
Reviewed-by: Joona Petrell
11 years agoDoc improvement for Image.fillMode.
Yann Bodson [Thu, 17 Mar 2011 06:12:29 +0000 (16:12 +1000)]
Doc improvement for Image.fillMode.

Change-Id: I2aec2c9fae07a8551001b2c7d5f5ab8da0fbb7df
Task-number: QTBUG-14899

11 years agoQDeclarativeView flickers when composited on MeeGo
Martin Jones [Thu, 17 Mar 2011 04:24:50 +0000 (14:24 +1000)]
QDeclarativeView flickers when composited on MeeGo

Set Qt::WA_OpaquePaintEvent and Qt::WA_NoSystemBackground for
QDeclarativeView on meego.

Change-Id: I301d2381ae831485d205ff42b0c15b3fa7a73424
Task-number: QTBUG-17173
Reviewed-by: Michael Brasser
11 years agoRe-enable lineHeight tests.
Yann Bodson [Thu, 17 Mar 2011 04:41:40 +0000 (14:41 +1000)]
Re-enable lineHeight tests.

These tests were disabled by 24d8e96624af91ab01a20c10625858300f16099b

Change-Id: I5bf3e11dfb3c975415c3039b39a39c22984d2900

11 years agoQt.include() used in WorkerScript is broken on Windows.
Martin Jones [Wed, 16 Mar 2011 03:09:21 +0000 (13:09 +1000)]
Qt.include() used in WorkerScript is broken on Windows.

The script local filename was used to resolve the source URL rather
than the script URL.

Change-Id: I78aa23eadbd76e100bb872b6ac9459aa9a5ee5ce
Task-number: QTBUG-17977
Reviewed-by: Aaron Kennedy
11 years agoDisabled non-QDeclarativeItems in Flickable break flicking
Martin Jones [Wed, 16 Mar 2011 02:08:42 +0000 (12:08 +1000)]
Disabled non-QDeclarativeItems in Flickable break flicking

Allow Flickable to steal grab from items that are disabled.

Change-Id: I71e401cd78695ecb2c3d47abde1c3d13e722d848
Task-number: QT-4677
Reviewed-by: Michael Brasser
11 years agoBorder still drawn on Rectangle elements when border.width == 0
Martin Jones [Tue, 15 Mar 2011 04:26:20 +0000 (14:26 +1000)]
Border still drawn on Rectangle elements when border.width == 0

The _valid flag did not consider both color alpha and line width in
both setters.

Change-Id: Iba544d65a0a40e36f1e09091e007418c9eefa0cd
Task-number: QTBUG-18102
Reviewed-by: Alan Alpert
11 years agoRegression: currentIndex was not set correctly after model cleared.
Martin Jones [Tue, 15 Mar 2011 03:53:34 +0000 (13:53 +1000)]
Regression: currentIndex was not set correctly after model cleared.

Change b3080d78f2ff2d98410249e09d5d7d6e20fd155c stopped the
currentIndex from being updated when a new item is added to an empty

Change-Id: I77a0789fcf3693034a2d7aca173fec669b913b18
Task-number: QTBUG-18123
Reviewed-by: Bea Lam
11 years agoRemove bindings before assigning constants in VME
Aaron Kennedy [Tue, 15 Mar 2011 00:25:54 +0000 (10:25 +1000)]
Remove bindings before assigning constants in VME

Change-Id: I4c246cbcf8d0168cb4af028d6d04088fe20cdbba
Task-number: QTBUG-17276

11 years agoFix TextEdit mouseSelectionMode overriding selectByMouse.
Andrew den Exter [Mon, 14 Mar 2011 00:47:36 +0000 (10:47 +1000)]
Fix TextEdit mouseSelectionMode overriding selectByMouse.

If selectByMouse is false don't allow any text selection on mouse

Change-Id: Ic9f309899bc0de48066a2393e088e15b3a2f06db
Task-number: QTBUG-18072
Reviewed-by: Martin Jones
11 years agoUpdate QML "What's New" docs.
Martin Jones [Fri, 11 Mar 2011 07:10:16 +0000 (17:10 +1000)]
Update QML "What's New" docs.

Change-Id: I80d2247cd05ef71907bbf690e8e68a8860a65d4c

11 years agoDon't reveal TextInput text on refocus in PasswordEchoOnEdit mode.
Andrew den Exter [Thu, 10 Mar 2011 06:38:20 +0000 (16:38 +1000)]
Don't reveal TextInput text on refocus in PasswordEchoOnEdit mode.

In PasswordEchoOnEdit mode return the display text instead of the
real text from inputMethodQuery() when not editing the password and
clear old password if new input is received through an input method

Change-Id: I7f24f510bf8e356e460900c3b9ff55ea16b32ab3
Task-number: QTBUG-17562
Reviewed-by: Joona Petrell
11 years agoFix ListView boundary extents for RTL layout.
Martin Jones [Fri, 11 Mar 2011 02:39:04 +0000 (12:39 +1000)]
Fix ListView boundary extents for RTL layout.

The delegates were laid out RTL, but the first item was not aligned
with the right edge.  Also fixes QTBUG-18037.

Change-Id: I6387c2f1ad37385376304f8cc76407b34d9fb834
Task-number: QTBUG-16010
Reviewed-by: Joona Petrell
11 years agoFix compiler warning.
Andrew den Exter [Fri, 11 Mar 2011 02:03:58 +0000 (12:03 +1000)]
Fix compiler warning.

Add parentheses around nested || statment.

Change-Id: I836b39b438dea5236d2c45a9920cd8307623df3d

11 years agoAnimatedImage does not change progress value
Yann Bodson [Thu, 10 Mar 2011 06:41:57 +0000 (16:41 +1000)]
AnimatedImage does not change progress value

This fixes QTBUG-17964 and make AnimatedImage behave like Image.

Task-number: QTBUG-17964
Reviewed-By: Martin Jones
Change-Id: I33996353a3b4ee0edb03741998f3ea893d4d31e5

11 years agoFix failing tests
Bea Lam [Thu, 10 Mar 2011 01:26:38 +0000 (11:26 +1000)]
Fix failing tests

RTL text-related tests were failing on mac since
QApplication::keyboardInputDirection() is not always initialized
when the QApplication instance is created.

Change-Id: Ifa7214ffb1941d824a9425015b38aa77366381bb
Reviewed-by: Martin Jones
11 years agoMerge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-qml
Kai Koehne [Wed, 9 Mar 2011 08:06:53 +0000 (09:06 +0100)]
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-qml

11 years agoFix line information for dynamic slots in .qml files
Kai Koehne [Tue, 8 Mar 2011 15:37:18 +0000 (16:37 +0100)]
Fix line information for dynamic slots in .qml files

Take whitespace before the opening bracket into account, e.g. save the newlines
in function f()\n{}

Task-number: QTBUG-18006
Done by Roberto Raggi

11 years agoMerge branch 'qtquick11' into 4.7
Joona Petrell [Wed, 9 Mar 2011 07:51:29 +0000 (17:51 +1000)]
Merge branch 'qtquick11' into 4.7

11 years agoAdd missing header include missing from the previous commit
Joona Petrell [Wed, 9 Mar 2011 07:48:12 +0000 (17:48 +1000)]
Add missing header include missing from the previous commit

Change-Id: I7993c13c7fe43027caaa28ef3866df5f0d21f5b9

11 years agoFix horizontal alignment of QTextDocument-based RTL text
Joona Petrell [Tue, 8 Mar 2011 08:05:25 +0000 (18:05 +1000)]
Fix horizontal alignment of QTextDocument-based RTL text

Task-number: QTBUG-15880
Reviewed-by: Martin Jones
Change-Id: If537d7c795dec46eedee62511e75bab862676ef1

11 years agoThe rotation reported by PinchArea should not be in the range -180..180
Martin Jones [Wed, 9 Mar 2011 06:56:05 +0000 (16:56 +1000)]
The rotation reported by PinchArea should not be in the range -180..180

The rotation is the total rotation that has been applied since the
gesture started.  This should not be normalized to -180 to 180.  If you
contort your fingers such that you have rotated 420deg then that is
what should be reported.

Change-Id: I24ba3f105befc2b0d31f1933911a94a0152ffcb4
Task-number: QTBUG-17437
Reviewed-by: Bea Lam
11 years agoRevert to previous lineHeight behavior.
Martin Jones [Wed, 9 Mar 2011 01:52:41 +0000 (11:52 +1000)]
Revert to previous lineHeight behavior.

f47f01fd34d08f6152c9053c0d6928fc359aa0f9 changed the height of the
Text to not include the extra spacing at the end of the block.  This
is different to what QDextDocument does.  Revert back to the old

Change-Id: Ie43dea4dd5a0e9ba179f44c246fb834322db11e3
Reviewed-by: Joona Petrell
11 years agoFix unstable qdeclarativeflickable test.
Martin Jones [Tue, 8 Mar 2011 23:48:47 +0000 (09:48 +1000)]
Fix unstable qdeclarativeflickable test.

Change-Id: I81b02147f88e948e3f3a663de0390893f8349fd9

11 years agoMerge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into qtquick11
Martin Jones [Tue, 8 Mar 2011 09:03:53 +0000 (19:03 +1000)]
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into qtquick11


Change-Id: Iddfc48e643a7f043afa1c5d5f1777f645a39548e

11 years agoUse the text layout bounds calculated by QLayout.
Martin Jones [Tue, 8 Mar 2011 04:55:56 +0000 (14:55 +1000)]
Use the text layout bounds calculated by QLayout.

We used to calculate the size and position of the cache image
ourselves.  Rather use the line positions and bounding rect calculated
by QLayout.

Change-Id: I601688ab7e310b0015a1994adf52b108f39504d8
Reviewed-by: Joona Petrell
11 years agoFix TextInput key navigation for RTL text
Joona Petrell [Tue, 8 Mar 2011 05:30:36 +0000 (15:30 +1000)]
Fix TextInput key navigation for RTL text

Task-number: QTBUG-15882
Reviewed-by: Martin Jones
Change-Id: I77c02de3bcd1a1d05dfcdd71327da45182050071

11 years agoBase empty QML editor horizontal alignment on QApplication::keyboardInputDirection()
Joona Petrell [Tue, 8 Mar 2011 04:33:29 +0000 (14:33 +1000)]
Base empty QML editor horizontal alignment on QApplication::keyboardInputDirection()

Task-number: QTBUG-15880
Reviewed-by: Martin Jones
Change-Id: I240d53c8572fd3d1222b555e93812a3ee38e2558

11 years agoUpdate TextEdit's visible selection when only the anchor changes.
Andrew den Exter [Tue, 8 Mar 2011 02:22:23 +0000 (12:22 +1000)]
Update TextEdit's visible selection when only the anchor changes.

At the limits of a TextEdit's text a key press can change/reset the anchor
position without changing the cursor position.  Checking the cursor position
alone isn't enough to determine the selection hasn't changed.

Change-Id: Ic425ac0c06897d77e9c86b907ff10b39d78dd7a1
Task-number: QTBUG-17982
Reviewed-by: Martin Jones
11 years agoMerge branch '4.7' into qtquick11
Joona Petrell [Tue, 8 Mar 2011 00:16:18 +0000 (10:16 +1000)]
Merge branch '4.7' into qtquick11

11 years agoInclude dynamic parenting use cases in layout mirroring autotests
Joona Petrell [Mon, 7 Mar 2011 07:25:44 +0000 (17:25 +1000)]
Include dynamic parenting use cases in layout mirroring autotests

Task-number: QTBUG-17280
Reviewed-by: Martin Jones
Change-Id: Ibbbd2da44d5826b6e499b731eda66b2016bade85

11 years agoPinchArea example produced incorrect scaling.
Martin Jones [Mon, 7 Mar 2011 05:32:07 +0000 (15:32 +1000)]
PinchArea example produced incorrect scaling.

The maths was dodgy - producing far greater scaling than that provided
by PinchArea.

Change-Id: I4a1ee1b0d65eed623ec9ee92c22c9740116430c5
Task-number: QTBUG-17828
Reviewed-by: Michael Brasser
11 years agoSet correct initial value for TextEdit and TextInput canPaste property
Yann Bodson [Mon, 7 Mar 2011 05:58:17 +0000 (15:58 +1000)]
Set correct initial value for TextEdit and TextInput canPaste property

Change-Id: Ied5b257305fa68db64fcf270ad2a42f691fbdca2
Task-number: QTBUG-17765
Reviewed-by: Martin Jones
11 years agoPinchArea example produced incorrect scaling.
Martin Jones [Mon, 7 Mar 2011 05:32:07 +0000 (15:32 +1000)]
PinchArea example produced incorrect scaling.

The maths was dodgy - producing far greater scaling than that provided
by PinchArea.

Change-Id: I4a1ee1b0d65eed623ec9ee92c22c9740116430c5
Task-number: QTBUG-17828
Reviewed-by: Michael Brasser
11 years agoFix documentation talking about old property LayoutMirror::mirror
Joona Petrell [Mon, 7 Mar 2011 05:02:01 +0000 (15:02 +1000)]
Fix documentation talking about old property LayoutMirror::mirror

Task-number: QTBUG-11042
Reviewed-by: Bea Lam
Change-Id: I3f842b7672ee57dadbd1ed9216249c36aa527d6a

11 years agoReverse horizontal alignment of QML editors when the layout mirroring is enabled
Joona Petrell [Mon, 7 Mar 2011 03:10:08 +0000 (13:10 +1000)]
Reverse horizontal alignment of QML editors when the layout mirroring is enabled

Task-number: QTBUG-15880
Reviewed-by: Martin Jones
Change-Id: Ie9cebd7bc6d40f5f555bfd83ddc3a24a55c6cb4d

11 years agoUpdate QtDeclarative def files
Joona Petrell [Thu, 3 Mar 2011 01:06:13 +0000 (11:06 +1000)]
Update QtDeclarative def files

Symbols introduced in Qt Quick 1.1 layout mirroring support.

Task-number: QTBUG-17280
Reviewed-by: Martin Jones
11 years agoRemoval of text alignment layout direction dependency was missing couple of changes
Joona Petrell [Fri, 4 Mar 2011 06:50:02 +0000 (16:50 +1000)]
Removal of text alignment layout direction dependency was missing couple of changes

Task-number: QTBUG-15880
Reviewed-by: Martin Jones
Change-Id: I1ea87b05c483e5c9339fc47cf719c22d001ef52b

11 years agoFix RTL multiline Text drawing
Martin Jones [Fri, 4 Mar 2011 04:33:30 +0000 (14:33 +1000)]
Fix RTL multiline Text drawing

We handled horizontal alignment ourselves, but this neglected some
RTL layouting issues (e.g. trailing spaces).  Allow QTextLayout to
do the aligning for us.  Also fix eliding of multiline text for
RTL language - in this case the eliding should be to the left.

Change-Id: I487137b123ae66c1f5fc358a8d8a013049d05818
Reviewed-by: Joona Petrell
11 years agoRemove text alignment of empty QML editors following the layout direction
Joona Petrell [Fri, 4 Mar 2011 03:26:12 +0000 (13:26 +1000)]
Remove text alignment of empty QML editors following the layout direction

Task-number: QTBUG-15880
Reviewed-by: Martin Jones
Removed implicit text alignment of empty text in QML editor
following the application's default layout direction.
Change was originally made few days ago in the commit
88253db8a7d7910e1393b1948fb3747117538c92. Aligning empty and
neutral text to the right for RTL locales requires much more
comprehensive changes to the Qt's internal text classes than
initially thought.

Change-Id: I93a26df259b87dff47d57423949270656746c9a7

11 years agoMerge branch '4.7' into qtquick11
Joona Petrell [Fri, 4 Mar 2011 02:53:48 +0000 (12:53 +1000)]
Merge branch '4.7' into qtquick11

11 years agoFix TextInput auto test failure on mac.
Andrew den Exter [Fri, 4 Mar 2011 00:52:13 +0000 (10:52 +1000)]
Fix TextInput auto test failure on mac.

Disable auto scroll so the relative position of the text isn't
changed when inserting text and changing the cursor position.

Change-Id: I6a18e91e98014f1e94216bc85241ebb0d604dd84
Reviewed-by: Bea Lam
11 years agoFix word selection locking on string boundaries.
Andrew den Exter [Thu, 3 Mar 2011 05:26:57 +0000 (15:26 +1000)]
Fix word selection locking on string boundaries.

QTextBoundaryFinder will return the position -1 if it reaches the end
of a string without finding a boundary, reset the cursor and anchor
to 0 or the string length as appropriate in those cases.

Also allow selection to lock onto the string limits as if they were

Change-Id: Ie9d233967c73eb6a61f19c76494f04bca18612f8
Task-number: QTBUG-17860
Reviewed-by: Martin Jones
11 years agoFix potential crash in QTextControl.
Lasse Holmstedt [Fri, 4 Mar 2011 00:34:57 +0000 (10:34 +1000)]
Fix potential crash in QTextControl.

inputContext() is only safe to call if there is a current

Change-Id: I6cbccf5f5fbb2d8c9ca6acf5f7e02f680eb84483
Reviewed-by: Andrew den Exter
11 years agoAdd a way to query the reading direction of QML editor text
Joona Petrell [Thu, 3 Mar 2011 04:43:42 +0000 (14:43 +1000)]
Add a way to query the reading direction of QML editor text

Task-number: QTBUG-17490
Reviewed-by: Martin Jones
Change-Id: I3dd3854f820860d32e822605ed547150d5f17eb2

11 years agoQDeclarativePropertyMap::keys() cannot be called from qml
Charles Yin [Wed, 2 Mar 2011 01:19:07 +0000 (11:19 +1000)]
QDeclarativePropertyMap::keys() cannot be called from qml

Not allow create dynamic properties which are same with existing method (method, signal, slot) names.

Change-Id: I0ae64c8a6a89ef4f7614169088f7c005edad40b0
Reviewed-by:Martin Jones

11 years agoCompensate for horizontal scroll in TextInput micro focus.
Andrew den Exter [Thu, 3 Mar 2011 00:18:21 +0000 (10:18 +1000)]
Compensate for horizontal scroll in TextInput micro focus.

Return the adjusted cursore rectangle rather than the one
returned by QLineControl.

Change-Id: I343ecdb47ef2ea59519c8d155bbb9917d9c8ce56
Task-number: QTBUG-17864
Reviewed-by: Martin Jones
11 years agoPosition the TextInput cursor correctly after IM text is commited.
Andrew den Exter [Wed, 2 Mar 2011 07:30:53 +0000 (17:30 +1000)]
Position the TextInput cursor correctly after IM text is commited.

If text is removed before the cursor position decrement not increment
the cursor by the by the difference.

Change-Id: If9558c88157cc884652af7aaf9bd5fad0ea822d8
Task-number: QTBUG-17863
Reviewed-by: Martin Jones
11 years agoMake the TextInput cursorRectangle relative to the item.
Andrew den Exter [Wed, 2 Mar 2011 05:53:48 +0000 (15:53 +1000)]
Make the TextInput cursorRectangle relative to the item.

The rectangle returned was relative to the text and didn't adjust for
horizontal scrolling.

Change-Id: I09227d73bbd8b32d830744d5911d785246051c2f
Reviewed-by: Martin Jones
11 years agoDon't assert if font engine creates new glyphs
Aaron Kennedy [Wed, 2 Mar 2011 02:57:55 +0000 (12:57 +1000)]
Don't assert if font engine creates new glyphs

Change-Id: Id18f58822f990788b511cbce02f8e4cf7d787c21
Task-number: QTBUG-14734

11 years agoMerge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Martin Jones [Wed, 2 Mar 2011 01:29:29 +0000 (11:29 +1000)]
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7

11 years agoDoc: remove experimental GestureArea from contents and add PinchArea
Martin Jones [Wed, 2 Mar 2011 01:28:06 +0000 (11:28 +1000)]
Doc: remove experimental GestureArea from contents and add PinchArea

Change-Id: I5eb6d2826f673c7067fde1447f25d3fc97b5aa5e
Reviewed-by: Bea Lam
11 years agoAdd QML file for TextEdit positionAt test.
Andrew den Exter [Wed, 2 Mar 2011 00:02:59 +0000 (10:02 +1000)]
Add QML file for TextEdit positionAt test.

Change-Id: I4632f77f87e8ced55a9959baaebd2b1624d0b568

11 years agoMerge branch '4.7' into qtquick11
Martin Jones [Tue, 1 Mar 2011 23:26:13 +0000 (09:26 +1000)]
Merge branch '4.7' into qtquick11


Change-Id: Ic21311365c6139520ae337a379bdedb6ffe497db

11 years agoMake sure horizontal QML editor text aligment always returns the actual alignment
Joona Petrell [Tue, 1 Mar 2011 02:51:27 +0000 (12:51 +1000)]
Make sure horizontal QML editor text aligment always returns the actual alignment

Also, implicit empty text alignment now follows the Application's default layout direction traditionally
set by the locale.

Task-number: QTBUG-15880
Reviewed-by: Martin Jones
Change-Id: I88340513d489290bafd393072786a19731097b77

11 years agoReverse KeyNavigation left and right properties when the layout mirroring is enabled
Joona Petrell [Tue, 1 Mar 2011 02:57:14 +0000 (12:57 +1000)]
Reverse KeyNavigation left and right properties when the layout mirroring is enabled

Task-number: QTBUG-15882
Reviewed-by: Martin Jones
Change-Id: I4c9f0b48e089b30ced5e7fefa5d6e97b3155f3b2

11 years agoAdd LayoutMirroring attached property for mirroring QML layouts
Joona Petrell [Thu, 24 Feb 2011 02:33:11 +0000 (12:33 +1000)]
Add LayoutMirroring attached property for mirroring QML layouts

Task-number: QTBUG-17280
Reviewed-by: Martin Jones
Change-Id: I34a623b49ce0fd5c05ae7a7ea5d0437c107b8a9b

11 years agoDon't return positions within preedit text from positionAt().
Andrew den Exter [Mon, 28 Feb 2011 06:54:08 +0000 (16:54 +1000)]
Don't return positions within preedit text from positionAt().

Preedit text isn't visible outside the inner workings of the Text
elements so any position returned that is greater than the current
cursor position is invalid.

Change-Id: I433fc635dcd6d087bde13fc47a1a92e4222a3b2c
Task-number: QTBUG-17834
Reviewed-by: Martin Jones
11 years agoAdd an is input method composing property to TextEdit and TextInput.
Andrew den Exter [Tue, 1 Mar 2011 00:19:22 +0000 (10:19 +1000)]
Add an is input method composing property to TextEdit and TextInput.

Allows input handling to be disabled or changed while an input method
is active.  This might be used to allow mouse events through to the element
or in conjunction with the cursor position to determine whether a click
occurred on the preedit text.

Change-Id: I35e148691920579c1d7c6f27b7e805d9551beadd
Task-number: QTBUG-17835
Reviewed-by: Martin Jones
11 years agoFix FolderListModel test - set folder to one containing files.
Martin Jones [Mon, 28 Feb 2011 22:27:17 +0000 (08:27 +1000)]
Fix FolderListModel test - set folder to one containing files.

Change-Id: I95aabd35c3a33b603aa3b11130ddea5f5c101ce9
Task-number: QTBUG-17775

11 years agoDrag over bounds errors when ListView has variable height content
Martin Jones [Mon, 28 Feb 2011 03:49:37 +0000 (13:49 +1000)]
Drag over bounds errors when ListView has variable height content

There are two related problems:
- when dragging variable height content up beyond bounds items are
destroyed, causing the maximum extent to change, which in turn causes
skipping.  This is fixed by storing the extents on press so that later
changes do not affect drag behavior.
- when variable height content is dragged beyond the bounds and
and released, items are created as the view returns to bounds.  This
changes the extents, however the bound target was not updated.  If the
viewport height changes during fixup the bounds animation is now

Change-Id: Ib37ec9e51f8ceb71af1e2e58f25fd8da18dcd632
Task-number: QTBUG-17769
Reviewed-by: Michael Brasser
11 years agoFolderListModel emitted incorrect rowsRemoved range causing crash.
Martin Jones [Mon, 28 Feb 2011 03:15:19 +0000 (13:15 +1000)]
FolderListModel emitted incorrect rowsRemoved range causing crash.

beginRemoveRows() takes the first and last index as parameters, but
it was passing count rather than count-1 as the last index.

Change-Id: I81a6fbf085acacf5f8c1ca847b0bdc826bcf405b
Task-number: QTBUG-17775
Reviewed-by: Bea Lam
11 years agofix/improve docs for new QtQuick 1.1 attributes
Bea Lam [Mon, 28 Feb 2011 02:31:50 +0000 (12:31 +1000)]
fix/improve docs for new QtQuick 1.1 attributes

Ensure attributes added in QtQuick 1.1 are marked with the
'\since QtQuick 1.1' tag. Also add links to items listed in the
QtQuick 1.1 section in whatsnew.qdoc.

Task-number: QTBUG-17771
Change-Id: Ic8fb3c8d3c99a1469c1767779efaafd27ef460e1

11 years agoFix test instability.
Martin Jones [Mon, 28 Feb 2011 00:12:47 +0000 (10:12 +1000)]
Fix test instability.

Allow the asynchronous view changes to complete before testing section

Change-Id: I09c7592205b6e3c55807ec1c5aa4b09f9cd8b92c

11 years agoDocument BorderImage::asynchronous
Alan Alpert [Sun, 27 Feb 2011 22:36:09 +0000 (08:36 +1000)]
Document BorderImage::asynchronous

It's been there forever, but someone forgot the documentation.

Task-number: QTBUG-16612

11 years agoEnsure layout is updated when section property changes.
Martin Jones [Fri, 25 Feb 2011 03:07:04 +0000 (13:07 +1000)]
Ensure layout is updated when section property changes.

When the section property changed the sections were recalculated,
but the items were not relayouted.
Also avoid 'Unable to assign undefined value' warning by setting
section item parent before component is completed.

Change-Id: I7bd8eb369877a6faf72b32b80b45a68366c95772
Task-number: QTBUG-17759
Reviewed-by: Michael Brasser
11 years agoQDeclarativeDebug: Export needed symbols on Symbian
Kai Koehne [Thu, 24 Feb 2011 07:56:04 +0000 (08:56 +0100)]
QDeclarativeDebug: Export needed symbols on Symbian

Allow applications to link against the QDeclarativeDebugService API.
This is needed for on-device debugging of QML. (The removal of
the symbols was a regression in 4.7.2).

Task-number: QTBUG-17503
Reviewed-by: Tom Sutcliffe
11 years agoAdd a 'CursorPosition' parameter to TextInput.positionAt().
Andrew den Exter [Thu, 24 Feb 2011 03:17:13 +0000 (13:17 +1000)]
Add a 'CursorPosition' parameter to TextInput.positionAt().

Specifies whether positionAt should resolve to the nearest position
between characters or the position of the nearest character.

Change-Id: I9eb2db2f8dd2accb2d9844ff204fba0337e71876
Task-number: QTBUG-16070
Reviewed-by: Martin Jones
11 years agoFix qmlviewer compilation on old Symbian platforms
Joona Petrell [Thu, 24 Feb 2011 00:07:00 +0000 (10:07 +1000)]
Fix qmlviewer compilation on old Symbian platforms

Task-number: QTBUG-17472
Reviewed-by: Martin Jones
11 years agoFix QPlainTextEdit corruption/crash with scrolling
mae [Wed, 23 Feb 2011 13:46:34 +0000 (14:46 +0100)]
Fix QPlainTextEdit corruption/crash with scrolling

There was an off-by-one error when QPlainTextEdit
calculated the number of visible lines (not blocks)
on the screne. When running into the error case,
the number of visible lines was falsely 0 (not 1),
which resulted in all softs of negative side effects
as the scrollbar permitted the user to scroll
behind the last paragraph.

Task-number: QTBUG-17230
Reviewed-by: con