Commit Graph

68 Commits

Author SHA1 Message Date
Jerome Pasion 779182eb4a Doc: Made Qt Quick items' \since consistent.
Qt 5.2:
-"\since QtQuick 2.2" -> "\since 5.2"

Qt 5.1:
-"\since QtQuick 2.1" -> "\since 5.1"
-"\since Qt 5.1" -> "\since 5.1"

Qt 5.0:
-"\since QtQuick 2.0" -> "\since 5.0"

Task-number: QTBUG-32172
Change-Id: I699b00b31373a434ddb8f4caccfef40c588bf8a4
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-09-25 13:51:06 +02:00
Lars Knoll a2d115fbaf Convert most remaining return values from Value to ReturnedValue
Change-Id: If8b0c3b91be50678693868c10fefc3678008834d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-18 13:13:55 +02:00
Lars Knoll d6837e9ca3 Rename QV4::ValueScope to QV4::Scope
The class is going to be used all over the place, so let's
give it a short name :)

Change-Id: If61543cb2c885e7fbb95c8fc4d0e870097c352ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-18 13:13:23 +02:00
Lars Knoll 002e6105f6 Require a ValueScope for ScopedCallData as well
This brings things more in line with ScopedValue, and
also simplifies cleanup of Scoped values.

Change-Id: If5f1466b4e13c629d56c1e7c638937f61ba48f77
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-18 13:13:21 +02:00
Lars Knoll a723c7ae75 Use a ReturnedValue when converting to String or Object
Also rename Value::toQString() to Value::toQStringNoThrow(),
and add a throwing toQString() method for JS use.

Change-Id: I821b33fc61abb7d08839df965fd337685f61a545
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-12 21:52:00 +02:00
Lars Knoll 6e8e5d16e1 Move CallData onto the JS stack
Change-Id: I22e853acfd2da337344b581bb0412c5f9930c510
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-11 13:01:50 +02:00
Lars Knoll 6f472680eb change calling convention for JS function calls
This allows faster pass through of the data if we have
nested calls.

Also make sure we always reserve at least
QV4::Global::ReservedArgumentCount Values on the
stack to avoid stack corruption.

Change-Id: I42976460f1ef11a333d4adda70fba8daac66acf3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-02 17:27:36 +02:00
Frederik Gladhorn d2628d9d70 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	tests/auto/quick/qquickgridview/qquickgridview.pro
	tests/auto/quick/qquickitem/qquickitem.pro

Change-Id: Ic54cafbdda1ac22757d2ee65dcc63a1b167c7556
2013-08-19 09:47:35 +02:00
Mitch Curtis 97daddee7a Don't repaint the Canvas if it's just changing position.
Task-number: QTBUG-33005

Change-Id: I94613c0a0e066798800e068aee7c6288fce54dbd
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-08-16 12:02:46 +02:00
Simon Hausmann 3a6f5735ee Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts:
	src/quick/items/context2d/qquickcontext2d.cpp
	tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro

Change-Id: I36a4fd28b3156839aecd70039a3ba566bf19a0bc
2013-07-22 13:43:43 +02:00
Marco Bubke ffe861a078 Request paint if scene changes for the canvas item
Otherwise for every scene the canvas is simply not painted anymore in the
designer. For example if you change the parent.

Change-Id: I4883eab44d73a59381230755f7caa596f2b6569f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-06-26 16:53:11 +02:00
Simon Hausmann 1a97598556 Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts:
	src/imports/qtquick2/plugins.qmltypes
	src/qml/debugger/qv8debugservice.cpp
	src/qml/qml/qml.pri
	src/qml/qml/qqmlcompiler.cpp
	src/qml/qml/qqmlcomponent.cpp
	src/qml/qml/qqmlcontext.cpp
	src/qml/qml/qqmldata_p.h
	src/qml/qml/qqmlengine_p.h
	src/qml/qml/qqmljavascriptexpression.cpp
	src/qml/qml/qqmlxmlhttprequest.cpp
	src/qml/qml/v4/qv4bindings.cpp
	src/qml/qml/v4/qv4irbuilder.cpp
	src/qml/qml/v4/qv4jsonobject_p.h
	src/qml/qml/v8/qqmlbuiltinfunctions.cpp
	src/qml/qml/v8/qv8bindings.cpp
	src/qml/qml/v8/qv8contextwrapper.cpp
	src/qml/qml/v8/qv8listwrapper.cpp
	src/qml/qml/v8/qv8qobjectwrapper.cpp
	src/qml/qml/v8/qv8qobjectwrapper_p.h
	src/qml/qml/v8/qv8sequencewrapper_p_p.h
	src/qml/qml/v8/qv8typewrapper.cpp
	src/qml/qml/v8/qv8valuetypewrapper.cpp
	src/qml/types/qqmldelegatemodel.cpp
	src/quick/items/context2d/qquickcanvasitem.cpp
	src/quick/items/context2d/qquickcontext2d.cpp
	sync.profile
	tests/auto/qml/qjsengine/tst_qjsengine.cpp
	tests/benchmarks/qml/animation/animation.pro
	tools/qmlprofiler/qmlprofiler.pro

Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
2013-06-24 11:48:46 +02:00
Gunnar Sletta 8fa9263cb1 Don't show a negative size canvas.
This is in line with how Rectangle and Image elements
also behave.

Change-Id: I82cd6ecc6d233645bb3fd968f0f81218188a8991
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-06-13 12:44:16 +02:00
Gunnar Sletta e500396d12 Fix resizing canvas with renderStrategy == Cooperative
updatePolish() called prepare() which would use a queued
metaInvoke() to change the size of the texture. However,
there is no guaranteed event processing on the render thread
between polish on the GUI thread and sync on the render
thread, we would very often get to updatePaintNode() before
the queued invoke landed, resulting the drawing being done
to a texture of the wrong size.

Fix this by calling prepare from updatePaintNode when
in CooperativeMode so that the autoconnection becomes
a direct one and we get prepare and flush processed in
the right order.

Change-Id: I0fa4687a94ada4bdaddca19133e686bca0bc745c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-06-13 10:00:56 +02:00
Simon Hausmann f0e32d311a Move QV8QObjectWrapper::newQObject into QV4::QObjectWrapper
...where it is just called wrap(), because it doesn't always create a new
JS wrapper for the QObject.

Change-Id: Ieed0fc97174eb51cd04df0149e715c234a5822bd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-05 10:55:08 +02:00
Lars Knoll 70f8279338 Get rid of v8::String::(Ascii)Value
Change-Id: I792a94590efbec852620d101b620b263a90e1d54
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-05-22 06:21:29 +02:00
Sze Howe Koh 3c9dd93a03 Doc: Fix some broken links
Change-Id: I1385a8947107a7c80b32306fc587aff45536a4ec
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-05-20 12:28:40 +02:00
Simon Hausmann 434b5cde86 Initial port of JS canvas bindings to use QV4::Object subclass instead of V8 resources
This patch comes with the same prototype injection as during the QML locale
patch. This will allow for incremental porting method by method for this huge
binding.

Change-Id: Ie258f021ac6f926302bb375a8ce7a12fb5e0512a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-05-10 18:33:28 +02:00
Lars Knoll 995d65f3f4 Cleanup v8 dependencies from QQmlV8Function
... and rename it to QQmlV4Function

Change-Id: Iad72347babf62691e26306877d4f229fda127eb7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-05-08 19:57:01 +02:00
Lars Knoll 2b0d3bf812 Remove v8 dependencies from QQmlV4Handle
Change-Id: I87d2183738ec7cfeea846a28f2b9aed79a233f68
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-05-08 19:55:58 +02:00
Lars Knoll b256bba1e8 Remove v8::Persistent usage from qquickcanvas
Change-Id: If714583818f894e8ac839cd35cd475deff00eafb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-05-08 15:33:06 +02:00
Simon Hausmann e021ff7ba2 Replace v8::Null() with QV4::Value::nullValue()
Change-Id: I7901d5282afd71c1fd66bab223b2811f0d14b5f1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-05-07 12:25:49 +02:00
Lars Knoll e537722604 Remove v8::HandleScope
This class never made sense with v4... :)

Change-Id: Id597d791d1adf52cc821d6d46f57cb24d1acd343
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-05-03 14:40:38 +02:00
Lars Knoll 7b8af027e5 Convert QObject methods inQV8Enginer to v4 based API
Change-Id: I954daac83b36d4cb667ecd7923577af90cfc4f9e

Fixup newQObject

Change-Id: I7b81754165b319a7fd81838313d0d654aad1132e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-04-29 13:16:17 +02:00
Gunnar Sletta a32ee86273 Mark the canvas texture dirty when we change it.
Because the texture is the same instance and the rect is the same,
the early-out checks in QSGSimpleTextureNode will abort.

Task-number: QTBUG-30666
Change-Id: I0e6a1fd3d4de33436057e8cdf62dc0e7964b5c21
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-04-26 08:42:28 +02:00
Sze Howe Koh 61b4e90a0f Doc: Qt Quick: Fix module name format (Pt 2/2)
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

Attempt to differentiate between the whole module ("Qt Quick") and the
QML import ("QtQuick") by encoding the latter with monospace font. There
are places in the text where both representations are valid.

Change-Id: If398304757e0a5106542c09099e1814084e54c5c
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-04-23 18:29:25 +02:00
Samuel Rødal e865df80a9 Fixed crash in QQuickCanvasItem.
The d->contextInitialized variable is useless as it gets out of sync
with d->context when the latter is set to 0. Simply checking that
d->context is non-null fixes some crashes.

Task-number: QTBUG-30810

Change-Id: I474a807a402396b170ba45ae7546781eea92b481
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-04-23 09:48:14 +02:00
Lars Knoll 3e08aa4249 Rename QQmlV8Handle to QQmlV4Handle
The handle wraps a V4 Value, so this is the better name for it.
Also added some accessor methods to convert to and from V4
Values.

Change-Id: I327c83feb5bd3be59909001489979e5a3a9d9e67
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-04-19 13:07:10 +02:00
Lars Knoll 94eee5842a Cleanup lots of V8 dependencies in QJS* classes
Implement a good part of QJSValue using V4.
Keep the QV8Engine for now (as it is used everywhere),
but add an ExecutionEngine pointer to it so other parts
can more easily be ported to V4.
Remove a lot of other stuff that's not required anymore.

Change-Id: Ibe2c9ab10f0ee977e0e3d05a42f526206d7b22b5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-04-18 12:43:30 +02:00
Gunnar Sletta b1f8c84eb5 Fix docs for Canvas.renderStrategy, the default is Cooperative
Task-number: QTBUG-29833
Change-Id: I3ee680d2decb01ff514852b2445617e6ab1b1480
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-03-03 19:43:08 +01:00
Gunnar Sletta 98e00abc19 Change Canvas to use Image and antialiasing by default.
Change-Id: I3033cba7c2f9e1dd9886e8f92ece1a2f43f60c01
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2013-02-26 15:13:54 +01:00
Sergio Ahumada 83deab8d1b Update copyright year in Digia's license headers
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-10 19:52:37 +01: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
Sergio Ahumada 1578f745bf doc: fix some typos in .cpp files
Change-Id: Ica7685aefde84ec80d8af7a67541af454de4adce
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
2012-09-07 13:59:27 +02:00
Charles Yin 373b8f06fa Use the new antialiasing property for canvas painting
Change-Id: I76f21d055696978f2f6936006eea038dd73cce6c
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-08-28 01:14:17 +02:00
Bea Lam 409d25b659 canvas-related doc fixes
- Fully qualify names in \qml* commands
- Remove unnecessary 'void' return types in \qmlmethod commands
- Remove unnecessary module and type qualifiers from links
- Document Canvas::onImageLoaded()

Change-Id: I32d1a7a54c407ae98b60857780f5536c6d52fca2
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-08-09 02:28:00 +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
Charles Yin 4236e7f7ee Refactor context2d thread logic
1. Use QQuickContext2DRenderThread for Threaded rendering
2. Make FBO target works with all render strategies
3. Remove some unnessary locks, call texture methods by invoking meta calls
4. Run existing tests with all render targets and strategies (except Cooperative)

Change-Id: I0db5c91d848b86bcc1536c30d7a5804b66a817f1
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-07-31 07:44:12 +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
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
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
Kent Hansen 6f7bb92e5d Avoid string-based lookup in IS_SIGNAL_CONNECTED
Specify the signal as a member function suitable for passing to
QMetaMethod::fromSignal(), and use the new function
QMetaObjectPrivate::signalIndex(QMetaMethod) to get the index in the
signal range.

Change-Id: If16daa24c2699f7749a17decb611cf395d89d0c4
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-06-10 13:47:15 +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
Charles Yin 1dcfa8aa2a Introduce QQuickCanvasPixmap
1. QQuickPixmap now only store textures instead of QImage data, however
context2d still need to access the QImage in some places, so cache the
loaded images to avoid the expensive GL readback operations.
2. Use texture directly if the render target is FBO.

Change-Id: I6228011e5698fa00f2e3420a3a4a305995b8a238
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-06-05 12:32:58 +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
Charles Yin 821ff61736 doc fix
renderTarget/renderStrategy property type should be enumeration.

Change-Id: I454c5c1d7b5be8290a25b81f8a9b9a54ebf515ec
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
2012-05-22 02:01:50 +02:00
Debao Zhang b8f732a65e Using QStringLiteral or QLatin1String instead of QLatin1Literal
Change-Id: Ie1435f1ac5c81d8781e7118121ed07c7202ab124
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-16 19:58:58 +02:00
Marius Storm-Olsen 2959cef741 Doc: Fix \sa usage
Ensure comma between elements (16 missing), single space and curly-
braces around title elements, etc.

Change-Id: I74e5a42e4a7054265c5c8445f8d2e2e6f46d0cf9
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-05-10 15:41:03 +02:00
Thiago Macieira 44f9412bf7 Change uses of {to,from}Ascii to {to,from}Latin1
This operation should be a no-op anyway, since at this point in time,
the fromAscii and toAscii functions simply call their fromLatin1 and
toLatin1 counterparts.

Task-number: QTBUG-21872
Change-Id: I03084595ddc425a988374b8352fd23e9504ffba6
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
2012-05-04 10:36:17 +02:00