Chris Adams [Fri, 23 Dec 2011 03:01:25 +0000 (13:01 +1000)]
Fix crash in var property setter
Previously, the function didn't terminate after calling the setter
recursively, as it should have. This patch ensures that the setter
is called correctly and then returns, and adds a unit test to ensure
that no regression occurs.
Task-number: QTBUG-23330
Change-Id: If512fca174e5224c2c53caad11f77782e6cead9f
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Michael Brasser [Thu, 22 Dec 2011 00:53:25 +0000 (10:53 +1000)]
Add a pressed property to TouchPoint.
Remove the valid property, and replace it with pressed. The semantics
have changed slightly for a release -- pressed will immediately become
false, whereas valid remained true until the next touch event.
Also make sure touch information is correctly updated on release.
Change-Id: Ic61e1b6884c67f19100a6f8fc218b8b05b291ff0
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Aaron Kennedy [Wed, 21 Dec 2011 18:44:26 +0000 (18:44 +0000)]
Reserve enough space in the QDeclarativePropertyCache hash
It was too easy for callers of copy() to pass the wrong reserve size,
so a new copyAndAppend() method has been added to reduce error.
Change-Id: If2f13e2e0733e5d87c527934dc5a6c8d0c8df572
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Aaron Kennedy [Wed, 21 Dec 2011 18:25:52 +0000 (18:25 +0000)]
Always register accessor properties
Otherwise if an Item gets created without the QtQuick module being
imported, the engine would fatal.
Change-Id: I441c7a61a60f07f2a7e3249253dea359d4ab1c35
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Alan Alpert [Tue, 20 Dec 2011 06:35:23 +0000 (16:35 +1000)]
Initialize more variables
Change-Id: I22f98c1562887769bc0f262120bd524f6f3b64df
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Alan Alpert [Tue, 20 Dec 2011 10:08:33 +0000 (20:08 +1000)]
Clear pending commits on reset
They will be caught when the nodes are rebuilt, if they're still valid.
Change-Id: Iac6e790b604a7deaba98a50dd07754459e9f5e14
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Aaron Kennedy [Wed, 21 Dec 2011 16:34:36 +0000 (16:34 +0000)]
Detect and optimize qsTr() and qsTrId() bindings
As these two are frequently used with constants, we can detect them in
the compiler, and run the appropriate C++ functions directly in the VME.
This saves pointlessly creating and running bindings.
Change-Id: I148a150400c13fda7955949453405202f18b1a6b
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Friedemann Kleint [Wed, 21 Dec 2011 08:06:26 +0000 (09:06 +0100)]
QDeclarative tests: Introduce base class for data tests.
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>
Kai Koehne [Tue, 20 Dec 2011 15:54:50 +0000 (16:54 +0100)]
Debugger: Allow transmissions of network packets in one go
We did call a flush() after every single packet, which was slowing down
things especially for the QDeclarativeDebugTrace service.
Change-Id: Idab074941a22364e154502eb12afa43b4dd33c22
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
Yoann Lopes [Thu, 15 Dec 2011 13:17:33 +0000 (14:17 +0100)]
Reference count glyphs in QSGDistanceFieldGlyphCache.
This was previously done only in the default cache implementation. It
has been moved to the base class.
releaseGlyphs() is called when a glyph is not referenced anymore by any
node.
Added a virtual function referenceGlyphs() that is called everytime glyphs
are being used in a node. This function is called just before
requestGlyphs().
Change-Id: If90f86c328c18ae2a5977847a6adf50b99ea1241
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Pekka Vuorela [Fri, 16 Dec 2011 09:15:42 +0000 (11:15 +0200)]
Adapted QDeclarativeTextEdit test to platform input context
Also couple more tests start to pass as side-effect
Change-Id: Ie3e8bafa1d397301da3f7af57b026f52b9cf5d21
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Pekka Vuorela [Thu, 15 Dec 2011 15:41:16 +0000 (17:41 +0200)]
Adapted QDeclarativeTextInput test to platform input context
Also a couple more tests starts to pass as side-effect.
Change-Id: I1723d4b5eccbe7abe2ac91ddc8318ac32c1f7e61
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Andrew den Exter [Wed, 21 Dec 2011 07:36:13 +0000 (17:36 +1000)]
Remove uneccessary layout in TextInput initialization.
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>
Jason McDonald [Wed, 21 Dec 2011 01:38:36 +0000 (11:38 +1000)]
Update obsolete URL's in test data.
Task-number: QTBUG-19653
Change-Id: I5682c9d99569a318ea8ffc7fa883cb41f51a32d6
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Andrew den Exter [Tue, 20 Dec 2011 07:21:55 +0000 (17:21 +1000)]
Delay initializing the canPaste property until it's requested.
With xcb querying data from the clipboard can take as long as 50 ms.
Deferring the check until it is requested speeds up construction time
when it's not used and only checking the available formats when it is
requested should also help.
Change-Id: I796fc83d0457d9ac1490cfb9f510c6342eb8a872
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Kai Koehne [Tue, 20 Dec 2011 12:41:50 +0000 (13:41 +0100)]
Debugger: Fix livelock on exit (Windows)
We used to close the debugger thread when the last service was killed: This happened
in the unloading of static global variables. Apparently this is too late on Windows,
since the OS thread associated was already terminated.
Instead, we now kill the instance when the QCoreApplication event loop is exiting.
Change-Id: I12a46ab9e7ac64561c94c0cd0d88b78fbaf8554c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Friedemann Kleint [Tue, 20 Dec 2011 14:46:17 +0000 (15:46 +0100)]
qdeclarativexmlhttprequest: Stabilize, ensure deletion of server.
Introduce QScopedPointer to make sure the server is also deleted in
case the test fails thus suppressing follow-up errors caused by
the port still being in use by a leaked server.
Change-Id: I9fd8a96ea5aba42487df8f22bc9a79917b9d8c16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Pekka Vuorela [Mon, 5 Dec 2011 15:03:18 +0000 (17:03 +0200)]
Make editors commit preedit themselves on losing focus
Change-Id: I1d42a8804068718c7347b4f652289f9724c25a3c
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Andras Becsi [Tue, 29 Nov 2011 14:24:27 +0000 (15:24 +0100)]
Use input event timestamps in QQuickFlickable if available.
Change-Id: If89ad205dec9ffdba4ca196cdc1a2e5fd9258260
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Pekka Vuorela [Tue, 13 Dec 2011 13:47:51 +0000 (15:47 +0200)]
QQuickLineControl more robust on input method & selection state
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>
Kai Koehne [Mon, 19 Dec 2011 15:58:31 +0000 (16:58 +0100)]
Debugger: Get rid of SG* prefix in qtquick2 plugin
Change-Id: Ib8a40d633c169652258480748cfc162593ed9f6c
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
Gunnar Sletta [Tue, 20 Dec 2011 10:33:00 +0000 (11:33 +0100)]
Emit the QQuickCanvas::frameSwapped signal again.
This got lost in the window manager rewrite
Change-Id: Ibaed76814ae676ce4ce3f50def196b8d67fd3df0
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Chris Adams [Tue, 20 Dec 2011 05:33:47 +0000 (15:33 +1000)]
Remove hardcoded assumptions about methods in QObject
This commit ensures that the number of methods available from the
QObject::staticMetaObject is looked up rather than hardcoded to
a value in the QDeclarativePropertyCache.
Task-number: QTBUG-22985
Change-Id: If61c02f0d32066cddaeac2d8143c58db97acb609
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Martin Jones [Tue, 20 Dec 2011 05:31:13 +0000 (15:31 +1000)]
Small Text creation performance improvements.
Change-Id: Ie92129887730d3738e14116cf22e1c30b836a415
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Fri, 16 Dec 2011 03:57:54 +0000 (13:57 +1000)]
Delay masking the last character in Password echo mode.
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>
Andrew den Exter [Thu, 15 Dec 2011 01:36:54 +0000 (11:36 +1000)]
Add wrapMode and verticalAlignment properties to TextInput.
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>
Andrew den Exter [Fri, 9 Dec 2011 02:55:32 +0000 (12:55 +1000)]
Ensure items in ListView and GridViews viewport are visible.
Unrequested items and items in the cache buffer are hidden by the views.
Make these items visible again if they enter the viewport due to a
relayout.
Change-Id: I574d1513e88c31c3c01a4a20ac77c21111279d3e
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Alan Alpert [Mon, 19 Dec 2011 07:58:49 +0000 (17:58 +1000)]
Fix affector group caching
It was possible for the cache to be updated before groups were properly
assigned, and it didn't update when they were.
Change-Id: If6835e2aad4a2412d17eb727da5d2414e4c20d60
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Alan Alpert [Fri, 16 Dec 2011 05:23:59 +0000 (15:23 +1000)]
Fix sprite chopping
Had some rounding around the wrong way.
Change-Id: I90ea339c35074ca7287c069bdbdd106578b1501b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Martin Jones [Tue, 20 Dec 2011 01:02:10 +0000 (11:02 +1000)]
Qt.locale() always returns the 'C' locale.
QLocale(QString()) does not return the default locale. If no
locale is specified, use the QLocale() constructor.
Change-Id: I76198b7ea66a6326483ec47ac36e080159ca459a
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Mon, 19 Dec 2011 03:46:56 +0000 (13:46 +1000)]
Fix valgrind warning.
Update the initial values of the VisualDataModel attached object
when binding to an object.
Change-Id: I2e11c8bf13198e848d11c8cea9885cb64240f941
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Martin Jones [Sun, 18 Dec 2011 23:51:16 +0000 (09:51 +1000)]
Don't enable multiline eliding unless wrap is enabled.
Setting the height of the Text element to less than the height
of the font caused the multiline eliding to activated. Also
ensure multiline eliding only elides a truncated first line if
it does not fit in the width allowed.
Change-Id: If7e88d6ad82cb12cdb53d92616e62c3895611115
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Mon, 19 Dec 2011 03:10:06 +0000 (13:10 +1000)]
Fix QDeclarativePropertyCache crash.
Reserve enough space in the signalHandlerIndexCache so that it will
not reallocated while the property cache is being built as this will
invalidate the pointers stored in the stringCache. Also ensure
signals for all cached meta-objects are included in
signalHandlerIndexCache, and don't over allocate propertyIndexCache
and methodIndexCache.
Change-Id: Ic285d832d4b86106176bfe723ff10bdd65143910
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Chris Adams [Wed, 7 Dec 2011 06:39:50 +0000 (16:39 +1000)]
Update the performance-tips documentation
Improvements to the JavaScript integration in QML means that developers
must be aware of some different performance related concerns.
This commit also adds some performance tips for other elements and
use-cases in QML.
Change-Id: Ia72f8c7ab275d3ff879fa195d59ecab102ca1f86
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Gunnar Sletta [Thu, 8 Dec 2011 12:24:17 +0000 (13:24 +0100)]
Implement "headless mode" for hidden QQuickCanvases
When all views are hidden, we stop the rendering thread,
kill the OpenGL context and all scene graph content.
The entire scenegraph is recreated based on the QML scene
when a view is shown again.
Change-Id: I734619d9f29263a5cdecbcc9b88c3808d1d64a7f
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Chris Adams [Thu, 15 Dec 2011 02:01:39 +0000 (12:01 +1000)]
Correctly resolve elements of QList<QUrl> properties
Previously, the value of a QList<QUrl> sequence was only resolved if
there was only one element in the sequence. This commit ensures that
all elements in the sequence are resolved correctly.
Task-number: QTBUG-23131
Change-Id: Id27748853fe01ae22800fbd02d062e268ad7ec70
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Chris Adams [Fri, 16 Dec 2011 00:58:20 +0000 (10:58 +1000)]
Remove another fragile assumption from var prop unit test
Commit
32c6ba2c3802bfda11e455c8aaaee41662c237fb removed hardcoded prop
indices from one test, but missed another test case which also
hardcoded a property index.
Change-Id: Iaac863f8176d09077ce1773b642cb88a01cc3fd1
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Sergio Ahumada [Sat, 17 Dec 2011 07:44:21 +0000 (08:44 +0100)]
Fix compilation due to header changes
- Fix QtGui/QApplication => QtWidgets/QApplication
- Fix QtGui/QStylePlugin => QtWidgets/QStylePlugin
- Fix QtWidgets/QStringListModel => QtCore/QStringListModel
- Fix QtWidgets/qstringlistmodel.h => QtCore/qstringlistmodel.h
Change-Id: I8df28f032f039107b900c81be27d2d6e5e69e06e
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Aurindam Jana [Wed, 14 Dec 2011 09:29:52 +0000 (10:29 +0100)]
Console APIs: Update documentation in QDeclarative
Change-Id: Ieb3887f128987c009d39071dd20e68f9e4fe6bc7
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Peter Yard <peter.yard@nokia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
Aurindam Jana [Thu, 15 Dec 2011 16:52:22 +0000 (17:52 +0100)]
DeclarativeDebug: Add version info to service plugins
Send the version info of each plugin alongwith the
plugin names to client.
Change-Id: I223689b32cdc5b0c48a4f508330033352b427937
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Alan Alpert [Thu, 15 Dec 2011 03:29:48 +0000 (13:29 +1000)]
Fix sprite-less sprite mode
Sprite performance mode is supposed to work even without sprites,
mostly for testing purposes.
Also renamed the testing variable from bloat to bypassOptimizations, and
removed it from the QML API (although it previously was hidden).
Change-Id: I436554d4ee2ed3a1770839b28aba8d8ef843469a
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Alan Alpert [Tue, 13 Dec 2011 05:44:21 +0000 (15:44 +1000)]
Add some more particles debugging information
Output registrations to help make system ownership clear. Only if debug
output flag set.
Change-Id: I75370eff1140e54aa5c23cc820342c89ef3af282
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Tue, 13 Dec 2011 03:56:42 +0000 (13:56 +1000)]
Make PlainText the default textFormat of a TextEdit.
With AutoText as the default it's easy to assume that a TextEdit accepts
plain text or rich text only which can lead to unexpected behaviour
when user supplied text is does not have the expected formatting and
implicitly changes the text format.
Task-number: QTBUG-23109
Change-Id: I08900fb23545672fd0e181058633bafeb826a746
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Fri, 11 Nov 2011 03:47:59 +0000 (13:47 +1000)]
Merge QQuickLineControl into QQuickTextInput.
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>
Simon Hausmann [Tue, 13 Dec 2011 16:18:45 +0000 (17:18 +0100)]
V8: Remove extra V8::Context allocated for expressing strong references
Moved the Referencer code into QV8Engine and re-used the available v8
context there. That also makes things a bit cleaner in the sense that now
references from one object to another are guaranteed to be within the same
context. Previously some strong references would be across contexts that
do not actually share a security token.
Change-Id: I717b27a4d96323feb570023d4d84f2b2176d1a84
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Roberto Raggi [Thu, 15 Dec 2011 08:50:51 +0000 (09:50 +0100)]
Fix IR code generation for member expressions
The generated code for member expressions (e.g. parent.width) was using
a wrong mix of types from the base object and names from the
current member expression.
Change-Id: I167df285ae44f9dc1538e2b1019998f02a0479a8
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Roberto Raggi [Wed, 14 Dec 2011 10:27:18 +0000 (11:27 +0100)]
Add support for QUrl types to V4
Extended the V4 instruction set with instructions to
`fast convert' url registers to string and bool registers
and `resolve' urls using QDeclarativeContext::resolvedUrl.
Also, made IR::UrlType a special `string' type. It's a little trick
to ensure that the compiler will generate correct conversions for
the binary expressions.
Change-Id: Ibc9e5b99302bd513f0cc52b598a1b198b11d4d30
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Aurindam Jana [Thu, 15 Dec 2011 09:54:45 +0000 (10:54 +0100)]
QV8DebugService: add version command
Version command to retrieve debugger version info.
Change-Id: I711e2a3d639c648cef50498fe5bbb9b6b8c6c1fe
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Simon Hausmann [Tue, 13 Dec 2011 09:04:40 +0000 (10:04 +0100)]
Fix that QJSEngine cannot be used from threads other than the gui thread
Implicitly allocate & enter an isolate per thread if needed, store it in TLS and
exit it upon thread destruction. As the code that represents QObject
dependencies in the GC through implicit dependencies uses its own context,
its per-thread data is folded into the v8engine TLS to ensure that it is
destructed before the isolate is exited.
Task-number: QTBUG-23099
Change-Id: I86538b54939b2fe64db843052eac04c7fd31813e
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Alex Wilson [Wed, 14 Dec 2011 06:10:15 +0000 (16:10 +1000)]
Add lineWidth property to QSGGeometry
Allows users to set a line width when using drawingModes GL_LINES,
GL_LINE_LOOP etc. Only calls glLineWidth on these drawingModes, and
does it just before the glDrawElements/glDrawArrays.
Change-Id: I2af583970b2acf0ddb59025a454caa75a8ddbd4f
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Andrew den Exter [Tue, 8 Nov 2011 02:09:39 +0000 (12:09 +1000)]
Don't emit model reset on completing a VisualDataModel.
The views try and retain their current state as much as possible on
a reset which prevents the current item being set to a valid item as
would happen if the VisualDataModel was completed before the view.
Change-Id: I593a850aeeb58846ab500f193487db4033e26399
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Andrew den Exter [Tue, 13 Dec 2011 05:42:49 +0000 (15:42 +1000)]
Activate links in a read only TextEdit.
Don't ignore mouse press events if the LinksAccessibleByMouse
interaction flag is set.
Task-number: QTBUG-23065
Change-Id: I25b3e3b0cf194b71fc863ed239196a567f42c19c
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Fri, 11 Nov 2011 00:06:41 +0000 (10:06 +1000)]
Remove unused code from QQuickLineControl.
Task-number: QTBUG-22627
Change-Id: I234977638ac6d42ad0fa648ae366823e5c542ed6
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Chris Adams [Thu, 15 Dec 2011 06:03:58 +0000 (16:03 +1000)]
Remove fragile assumption from var properties unit test
Previously, the test included some hardcoded property index values
which would break if the layout of an item changed. This commit
ensures that the index of the properties are looked up dynamically.
Change-Id: I5a499f81a0cb859d89f0972eb7cd645107336bc9
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Thu, 15 Dec 2011 03:22:49 +0000 (13:22 +1000)]
Remove QQuickTextControl::ensureCursorVisible()
QQuickTextEdit doesn't implement scrolling internally and QML code
will use the cursorRectangle property to determine if it should scroll.
All instances of ensureCursorVisible() have been replaced by
cursorRectangleChanged() which was previously microFocusChanged().
Task-number: QTBUG-22627
Change-Id: I5df9e1d1cb4a8553eabd417a658e80da1c27e10c
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Thu, 15 Dec 2011 03:18:27 +0000 (13:18 +1000)]
Remove unused code from QQuickTextControl.
QTextControl included a lot of functionality that was unused by
TextEdit. Anything that is unused and therefore untested should
go.
Task-number: QTBUG-22627
Change-Id: Ie68b279cb8618bec0af76287c7c4db34d0642a0a
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Thu, 15 Dec 2011 02:41:56 +0000 (12:41 +1000)]
Utilize the property cache for item view context objects.
A common QDeclarativePropertyCache was being constructed for dynamic
objects but never bound to the constructed objects.
Change-Id: I83b3841d8b78e2f2dd8e0494ea2601c20d6e6e88
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Friedemann Kleint [Wed, 14 Dec 2011 15:24:46 +0000 (16:24 +0100)]
qdeclarativelanguage-test: Fix location.
Introduce the standard method of locating test data
(QFINDTESTDATA).
Change-Id: I4074396a7631cf68060c02b716fa7e1b95d6e22d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Laszlo Agocs [Sat, 10 Dec 2011 14:22:00 +0000 (16:22 +0200)]
Update QDeclarativePinchArea autotest.
Similarly to the QtQuick2 tests this one also needs some minor changes
to make it compile with the recent touch changes in qtbase.
Change-Id: Ie7114dc181579b45c850cb0cf18eb1168a37d8d4
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Aurindam Jana [Wed, 14 Dec 2011 11:50:41 +0000 (12:50 +0100)]
QV8DebugService: Add breakaftercompile
Add breakaftercompile command that will set the v8::DebugBreak()
whenever a new script is compiled.
Change-Id: Id9027066826b6de621058d3170fa628463ef0152
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Aurindam Jana [Fri, 2 Dec 2011 13:52:21 +0000 (14:52 +0100)]
QV8DebugService: Simplify the service code
Removed all parsing functionality. The service only acts as a delegate
to v8 debugger. Apart from that, it calls the v8 debug static APIs
when requested by client.
Change-Id: I2917c2d080e5b409a4b5f39d386279c33634cade
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Kai Koehne [Wed, 14 Dec 2011 13:13:45 +0000 (14:13 +0100)]
Link against librt to make use of clock_gettime
Allow using qdeclarativetrace_p.h on Linux
Change-Id: Ib5d9dad156897ea40825136ac2e818c1250ad403
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Pekka Vuorela [Fri, 9 Dec 2011 13:28:13 +0000 (15:28 +0200)]
QQuickTextControl - mouse events to override input context
- Selection can start on top of preedit
- Mouse press outside preedit commits
- Double click to commit on top of preedit
- Focus out to commit preedit
Similar to qtbase
4b3d88a9c67402b6a234d597bab25846f039bbdb and
b5c37d9e137dee2754335e83b8437dfd0e6cc7e7 for QTextEdit
Change-Id: Ib9c37528ba7fd588ee993b7ff33f79f96857e421
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Pekka Vuorela [Fri, 9 Dec 2011 13:30:26 +0000 (15:30 +0200)]
Protect QTextControl::setTextCursor for existing preedit
Change-Id: I29fc7c472a3a20eeaf74e0dc411313e5750e9dee
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Yoann Lopes [Tue, 13 Dec 2011 13:42:00 +0000 (14:42 +0100)]
Support for multiple textures in the distance field glyph node.
Distance field glyph nodes can now have their glyphs in different
textures.
Change-Id: Ia4cdf12f8791246779c890e4ff224927bdfa1156
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Pekka Vuorela [Fri, 9 Dec 2011 13:15:21 +0000 (15:15 +0200)]
TextEdits to include tentative commit in text property
Similar to what qtbase
1dbfbf4c66187e7522888c19d78024cfceaea570
did for QTextEdit. Now available only in plain text, html support
pending.
Change-Id: I0b23a45fc484512d3354f66e1a6134e2d70eb8b5
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Simon Hausmann [Mon, 12 Dec 2011 13:04:39 +0000 (14:04 +0100)]
Cleanup: Fold QV8GCCallback class declaration(s) back into qv8engine_p.h
The implementation lives in qv8engine.cpp.
Change-Id: I2898556fea867cdc82ea534eaf020dd8d12b25d6
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Simon Hausmann [Mon, 12 Dec 2011 12:41:25 +0000 (13:41 +0100)]
Fix leak of v8 context used for implicit strong references.
QV8GCCallback::Referencer keeps strong implicit references for QObjects
owned by C++ (or objects with a CPP owned root parent). The implicit v8
object to express the implicit reference belongs to a dedicated v8 context,
which needs to be disposed properly.
Change-Id: Ic0555cb8d94384a185ebcee9825988d84e74f26b
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Yoann Lopes [Tue, 13 Dec 2011 10:18:33 +0000 (11:18 +0100)]
More distance-field cache refactoring.
The distance field glyph node now uses preprocess().
The glyph cache is updated at that time, then when all the glyphs are
ready the node's geometry is updated.
addGlyphPositions and addGlyphTextures in QSGDistanceFieldGlyphCache
have been renamed to setGlyphsPosition and setGlyphsTexture to reflect the
fact that they can be used to update existing glyphs. For example when
a glyph has moved to a different texture.
When an existing glyph is updated, all nodes containing that glyph are
invalidated and their geometries are reconstructed with the new values.
Change-Id: I7758313155f48811e6027434e6c9a1c3df5dfab7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Martin Jones [Wed, 14 Dec 2011 05:20:25 +0000 (15:20 +1000)]
Correctly ignore unknown tags in StyledText
Also improve tests to compare expected formatting and improve coverage.
Change-Id: I021dbdcd147dd7340a0dc1c30f4b104f22efece0
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Andrew den Exter [Wed, 7 Dec 2011 03:03:08 +0000 (13:03 +1000)]
Add a tutorial describing how to re-arrange items in a ListView.
This example describes both how to use drag and drop to re-order items
and how to use VisualDataGroup to sort a view using model data.
Change-Id: I034963ea87c8ab0c30555536ac28495a396c0577
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Andrew den Exter [Tue, 13 Dec 2011 07:17:56 +0000 (17:17 +1000)]
Fix crash when items are moved in model.
When erasing an item we need to backtrack to the previous item so the
next iteration doesn't skip an item. In the worst case the next item
is the last and a failure to backtrack will cause the loop to wrap
around and run over the list again.
Task-number: QTBUG-23107
Change-Id: I82156f6fc1f7973ba11f09a4694230c77c293757
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Aurindam Jana [Tue, 13 Dec 2011 10:32:35 +0000 (11:32 +0100)]
QDeclarativeBuiltinFunctions: Remove warning
Change-Id: Id603b5a47d993d07a0562a457d9d03752e9d8151
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Johannes Zellner [Mon, 28 Nov 2011 19:25:54 +0000 (20:25 +0100)]
update: make fragment shader code for distance field work with tegra2
Change-Id: If907389dc904e9963aa87e5efdc39664e74d1eea
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Aaron Kennedy [Fri, 9 Dec 2011 12:39:23 +0000 (12:39 +0000)]
Add a tracing API for the QML engine
Change-Id: Ic03583444d586f275897d765be8e1b5e69fdd5d4
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Aurindam Jana [Thu, 10 Nov 2011 14:59:05 +0000 (15:59 +0100)]
QV8Engine: Console APIs, Extend functionality
Added console.trace, console.profile, console.profileEnd.
Change-Id: Icc38ddd550989eaba0085ece120695a13ec17322
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Gunnar Sletta [Tue, 13 Dec 2011 10:06:15 +0000 (11:06 +0100)]
Support opening filedialog again in qmlscene
Change-Id: If6d7dded83a4bbb5d68b74741fc7a531165b7fef
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Simon Hausmann [Tue, 13 Dec 2011 09:03:20 +0000 (10:03 +0100)]
Cleanup: Remove redundant call to QV8GCCallback::registerGcPrologueCallback()
The same call is done a few lines above, and calling the function multiple times
has no effect after the first call.
Change-Id: Ibcf10ec88b0f5182d2963e4bfe532ff6a4e5a4ad
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Kim Motoyoshi Kalland [Thu, 17 Nov 2011 15:36:53 +0000 (16:36 +0100)]
Made QSGNode flags togglable and added StaticSubtreeGeometry.
The UsePreprocess and ChildrenDoNotOverlap flags could previously
only be set during node initialization. They can now be toggled.
This change also introduces the StaticSubtreeGeometry flag which is
meant to be used to indicate that all the nodes in the sub-tree
have static matrices and vertex data.
Change-Id: I3b182b81f7010aea636f8f654ef22dab19bc6b29
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Friedemann Kleint [Tue, 6 Dec 2011 12:58:21 +0000 (13:58 +0100)]
Fix warnings about struct/class mismatch (QDeclarativeAccessor).
Change-Id: I85cb4042db9b4417f1098a65e99c5524e829fe92
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Alan Alpert [Mon, 12 Dec 2011 01:32:32 +0000 (11:32 +1000)]
Augment Samegame with resource efficient particle system
The particle system cannot automatically turn itself off when it's not
needed, however it is easy enough to do so manually. This change does so
in SameGame as an example.
Task-number: QTBUG-22923
Change-Id: I5f2b3e572222f03c9412fd24c40276529e7d0e7e
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Alan Alpert [Tue, 13 Dec 2011 01:07:56 +0000 (11:07 +1000)]
Initialize Variable
Change-Id: I9870ca9784896fb780dc0474f6fa603f316d59d4
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Martin Jones [Tue, 13 Dec 2011 02:37:10 +0000 (12:37 +1000)]
Support <strong> in styled text.
Task-number: QTBUG-23105
Change-Id: I15968c43fd0797b94584f110c6aeca06eca832b7
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Martin Jones [Thu, 8 Dec 2011 00:36:44 +0000 (10:36 +1000)]
Add basic custom easing curve docs and test
Change-Id: Id38434cb71417276635b501d13d0145759de9864
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Pekka Vuorela [Wed, 7 Dec 2011 13:41:45 +0000 (15:41 +0200)]
QtQuick TextEdit to set view property to QTextController
Controller wants to know on some cases where it's attached to.
Change-Id: I48df57ea1233a307f4d7424f0f944755604e3a6e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Simon Hausmann [Mon, 12 Dec 2011 14:32:17 +0000 (15:32 +0100)]
V8: Minor cleanup
Moved context creation into the QV8Engine constructor body. That will make
it easier to execute other initialization stuff in the future, such as
per-thread isolate creation.
Change-Id: Id4aef76d3664a3810143907d2201203b18745a47
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Gunnar Sletta [Mon, 12 Dec 2011 07:56:14 +0000 (08:56 +0100)]
Initialize variable
Change-Id: Ie88f21c4e4c53a023f03f906d2fae7540fbc668d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Friedemann Kleint [Mon, 12 Dec 2011 10:57:47 +0000 (11:57 +0100)]
QtQuick: Fix compiler warnings.
Mostly introduced by
fdd14a1a10a0a2f42015b30071771bd95215cc1a.
Change-Id: Ief4c33412ef80923de2f91e62bb89c18267a14f3
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Andrew den Exter [Thu, 10 Nov 2011 04:19:32 +0000 (14:19 +1000)]
Create a copy of QLineControl in the QtDeclarative library.
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>
Gunnar Sletta [Mon, 12 Dec 2011 06:18:03 +0000 (07:18 +0100)]
Link against widgets only when available
Change-Id: Id7c474fe48bfa99d765267c0e3be1cbf80597548
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Andrew den Exter [Mon, 12 Dec 2011 04:50:01 +0000 (14:50 +1000)]
Fix TextInput not reacting to text color change.
Trigger a relayout with the new color when the color property is
changed.
Task-number: QTBUG-22402
Change-Id: I2dc190e097e878ac498fd04c2800a6e11947527c
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Andrew den Exter [Mon, 12 Dec 2011 02:46:48 +0000 (12:46 +1000)]
Fix test failures in QtQuick 1 TextEdit and TextInput.
Port various fixes for incompatibilites from the QtQuick 2 item tests.
Task-number: QTBUG-21017
Change-Id: I0234fa2623c57138a132558ff4f48602675c3784
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Andrew den Exter [Fri, 9 Dec 2011 06:30:46 +0000 (16:30 +1000)]
Size TextInput cursor correctly.
Use the cursorRectangle property to size and position the TextNode's
cursor rather than recalculating the rectangle in an incompatible way.
Task-number: QTBUG-22386
Change-Id: I8ee02b590796b0304683b9b246aba1e59c1fd6a5
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Andrew den Exter [Thu, 8 Dec 2011 07:52:35 +0000 (17:52 +1000)]
Fix package items not being destroyed when a package is destroyed.
The views parent the delegate items to themselves on creation, before
we delete the package we need to reparent them back to it or they'll
persist indefinately.
Change-Id: I01a36fadb2b0ff1035de46ec2b84a54d73c49bcf
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Mikko Harju [Thu, 8 Dec 2011 11:24:12 +0000 (13:24 +0200)]
QmlProfiler: stream snapshots to reduce memory footprint
Taking a V8 heap snapshot with QV8ProfilerService created multiple
copies of the snapshot data, causing overhead of several megabytes.
This patch changes the snapshot protocol to stream the contents over
the debugger connection.
Change-Id: I90054210233d52dd02aa838201f9b024d578fcea
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Aaron Kennedy [Fri, 9 Dec 2011 18:00:43 +0000 (18:00 +0000)]
Don't access QDeclarativeProperty from bindings as often
Soon QDeclarativeBinding will store the property internally in its
constituent parts and construct the QDeclarativeProperty only when
it is requested.
Change-Id: Id2d7573ffd49aac783737ea6d20aac4e157a9600
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Laszlo Agocs [Thu, 8 Dec 2011 10:46:47 +0000 (12:46 +0200)]
Set target and device for touch events.
The QWidget dependency is being removed from QTouchEvent and therefore
widget() will be removed. There will be QObject *target() instead.
deviceType() has been deprecated and is replaced by QTouchDevice
*device().
Change-Id: Ic07b2c620fbfc1ae2e5eff85c8fc7269c7d5e2a8
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Caroline Chao [Tue, 29 Nov 2011 09:48:21 +0000 (10:48 +0100)]
Integrate testcocoon support into QtQuickTest.
Add support to install and save coverage data when a test is run
using quick_test_main.
Change-Id: I39ddd678d748979c335139b3f8bda43b3d05720d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Kent Hansen [Wed, 12 Oct 2011 12:27:57 +0000 (14:27 +0200)]
Get rid of QDeclarativeMetaType::{canCopy,copy}
Now that we have QMetaType::construct() that does placement new
construction, we can use that to copy the value.
We need to destruct the (default-constructed) existing value first,
but for primitive types that's a no-op, and for Qt's types it's
cheap since they use lazy initialization or "shared null".
Change-Id: Idadee04b1d5b590be7fec50fb0396fd277bee973
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Pekka Vuorela [Fri, 9 Dec 2011 09:40:27 +0000 (11:40 +0200)]
Remove dead private method from TextEdit implementations
Change-Id: I6c9a7c71607167b326dc45a35d97bcaf25a9d1b9
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>