Commit Graph

10844 Commits

Author SHA1 Message Date
Lars Knoll 833c99db20 Inline property data into the object
Append the part of the objects property data that is
known ad instantiation time to the object itself and
by that avoid creating a separate MemberData. Saves
some memory and should speed up object creation.

Currently implemented only for Object and ArrayObject.

Change-Id: I7693bf2f3a28fb718522398ebb94ac115e021fa4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-22 08:19:53 +00:00
Frank Meerkoetter 884097f463 QV4_MM_STATS was missing largeItem details
The output of QV4_MM_STATS was only reporting the items allocated on the
JS HEAP. It was missing out on the LargeItems which are allocated on
the C++ heap.

Change-Id: Ife3d7afd769beb31afd1ed681d503f9811b03b96
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-22 07:12:55 +00:00
J-P Nurmi b7738beda6 Make QML composite types inherit enums
Problem: in Qt Quick Controls 2, enums declared in the abstract
C++ base types were not accessible with the concrete QML type name,
but had to be referenced using the base type name:

    Slider {
        snapMode: AbstractSlider.SnapOnRelease
    }

Solution: this change resolves the C++ base type and creates the
missing link between the composite type and its base type's meta-
object. This allows referencing enums using the concrete/composite
QML type name:

    Slider {
        snapMode: Slider.SnapOnRelease
    }

Change-Id: Icefdec91b012b12728367fd54b4d16796233ee12
Task-number: QTBUG-43582
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-21 19:59:27 +00:00
Simon Hausmann ba7edffda3 Remove some dead code
Also get rid of the unnecessary QQmlCustomCompilerBackend interface.

Change-Id: I6cfdd88ef49d3d314d07aa069da481d304e7a285
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-09-21 19:59:23 +00:00
Dan Cape 0f29340a10 TextEdit: selectedTextChanged not emitted when calling select 2nd time
qquicktextcontrol was only checking if the text was previous selected
or not and if the current state matched the previous state it would not
dispatch a selectedTextChanged event. This is wrong if you
programmatically select text a second time with a different start or
end of selection. You must notify that the selected text changed since
visually you can see the highlight changed locations.

When correcting this and creating a test case, it was seen that other
tests had QEXPECT_FAIL set for this specific case. Upon further
inspection, I could remove those calls and adjust the expected data
that was set before the test (changing false to true).

testing of tst_qquicktext:
Totals: 182 passed, 0 failed, 0 skipped, 0 blacklisted
testing of tst_qquicktextedit:
Totals: 354 passed, 0 failed, 3 skipped, 0 blacklisted

Task-number: QTBUG-38704
Change-Id: Ib5244dc264ab76951bb722a31dcb64717282725a
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2015-09-21 13:53:49 +00:00
Nobuaki Sukegawa 8614d4d836 Add DataView unsigned integer getter/setters with correct casings
According to the spec, unsigned integer getter/setters should be cased "Uint".
http://www.ecma-international.org/ecma-262/6.0/#sec-dataview.prototype.getuint8

For backword compatibility, this diff does not remove mis-cased methods.

Change-Id: I8e65dca12b8358376dbb3c519246c8abca0d47b0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-09-21 13:48:35 +00:00
Gabriel de Dietrich c5b083b2a2 ListView: Set currentItem's culled state on geometry change
When the viewport is moved, the ListView may cull its currentItem
if it's out of the viewport bounds. However, it could be that this
is only a transient state while the currentItem is being animated.
Unfortunately, we don't uncull the currentItem at any moment during
the animation.

To solve this, we simply set the currentItem's culled state every
time its geometry changes.

Change-Id: I72d548f13f229029ccd8568721ea23e73f7b4392
Task-number: QTBUG-48044
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2015-09-21 13:33:48 +00:00
Mitch Curtis 4c1a705050 Fix typo in scenegraph documentation
Change-Id: Iacab320dcedfc7ba1d12703f63a812f2660929b7
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-09-21 13:03:41 +00:00
Ulf Hermann 14bd3aa88f QmlDebug: Make sure debug server knows connection before any messages
In some cases the connection may relay a message to the server directly
when calling one of the connect methods. This leads to a crash if the
server, due to not knowing the connection yet, cannot reply.

Change-Id: Iac2da08c621b70c2e5a1922efad0cd6ae4edc4e1
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-09-21 13:01:16 +00:00
Albert Astals Cid 53b0c5dd49 Add const & to a few iterators
Change-Id: I0ed3a592e9d6f1ac114af7a998517d9aa3b56828
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-21 10:39:06 +00:00
Albert Astals Cid e6a4fdd519 Improve QQuickTextureFactory::textureFactoryForImage docu
Change-Id: I80edbcf627c6a2ba27779d0edfe8f0343b765dda
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-09-21 07:50:54 +00:00
Frank Meerkoetter 76c7d955d6 Remove getter
Emphasize this is something internal

Change-Id: Ifd92be0d25d7e0767819b8162c2602608916bc10
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-16 06:57:09 +00:00
Frank Meerkoetter 09c2013bdc Adapt to the new QV4::MemberData API
The size of the allocation can not change to an exact size'd alloc()
can be used here.

Change-Id: I479997efe8af15932d424019237683d89e945ed9
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-09-16 06:56:56 +00:00
Frank Meerkoetter e774b9a972 Adapt to the new QV4::MemberData API
This allocation doesn't grow so use an exact sizes one.

Change-Id: Ib0117b3a1932bcdc26a4aac6759a08db43a90225
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-16 06:56:46 +00:00
Lars Knoll b58c33da59 Get rid of propertyAt in Object
Change-Id: I3022b3c5c1ae90530ef5ca88e0b88a2fd1102e73
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:13:20 +00:00
Lars Knoll 15cd948bda Replace __getPropertyDescriptor__ with a getValueOrSetter call
This one returns a pointer to a Value instead of a property.

Change-Id: I66e16526cc61d1ff3564cae983881c30b9106b54
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:13:16 +00:00
Lars Knoll 7d52d7e529 Don't return Property * from ArrayData::insert
Change-Id: Ibabee04a17f5b2f3ba993cd61cbe64c897031f71
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:13:12 +00:00
Lars Knoll e13b9624b0 Further reduce usage of Property
Using Property * as return value is something I wanted to get rid of for
a long time. As this interferes with storing properties inline in the
Object, now is a good time to finally do the work :)

Change-Id: I30594bad9a4cea5d9d606ebe02d7f3e707b4263a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:13:07 +00:00
Lars Knoll 665f17782a Simplify Object::getValue
Object::getValue only needs the value/property getter. Because of this
it's enough to pass it the Value stored in the member/arrayData and the
property attributes. Like this we avoid the reinterpret_cast to a
Property pointer.

Change-Id: Ib6873526f9db22ed0e607e3617be5729b15271ab
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:13:03 +00:00
Lars Knoll 9ea6c69ab5 Simplify Object::putValue()
Change-Id: I1cc43f0081f63aed27c82875192e0f415ec995d5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:12:59 +00:00
Lars Knoll c5f3028d43 Cleanup
The property is always value based, so there's no need to
cast to a Property* when returning it.

Change-Id: I095a940197aedac90ad9f5491ccb9af0ca53d722
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:12:54 +00:00
Lars Knoll 458892bcd5 Encapsulate the remaining direct accesses to Object::memberData
Change-Id: I17f202cf58dc355524b89a456e6722d41e444ca1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:12:51 +00:00
Lars Knoll 64c3e1cbb1 Cleanups
There's only one place where we need to resize our member
data, namely when we call setInternalClass() on an object.

In addition, encapsulate the access to the memberdata better
in preparation for inline property data later on.

Change-Id: Ia34d0253d5d1792f1d7c4981556d78375fa7a755
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:12:47 +00:00
Lars Knoll fb52dab6b4 Further cleanups
Reduce usage of ScopedContext.

Change-Id: I84a6a7478065de3398fd0b21596ca1308e78ceb3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 19:12:40 +00:00
Friedemann Kleint da705f4036 Refactor TestHTTPServer.
- Prefix member variables by m_.
- Coding style fixes, wrap line long lines and statements.
- Compile with QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII.
- Introducde Qt 5 connection syntax.
- Streamline code.
- Use iterators for hashes.

Change-Id: Ib6528220063248e09f7c19594233b7cd5940e0a8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 13:18:16 +00:00
Aleix Pol 620b67ee15 Don't compute the QString whenever we need to know the v4 string length
The length is already computed in the len attribute anyway.

Change-Id: I1a406175edd9127b9b425eb21703e2184f5a3cd7
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-09-15 13:17:00 +00:00
Ulf Hermann a7003d3a1e Remove quotes from debug connector error messages
The client expects them without quotes and other error messages
don't have quotes (except for some in QQmlDebugServer which have
to be replaced anyway).

Change-Id: I75716f9223b268697801a91ea506817647e1e594
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 08:26:35 +00:00
Gunnar Sletta 0c7349fa96 Introduce QQuickPaintedItem::textureSize and support HighDpi.
contentsSize/Scale/BoundingRect are confusing and will in
most cases not produce what the user wants, but since
they might be in use, we keep their behavior and simply
obsolete them. New code should use textureSize, though most
code can simply rely on implicit HighDpi support.

[ChangeLog][QtQuick][QQuickPaintedItem] Implement high-dpi
support and add function textureSize. This obsoletes the
existing contentsSize, contentsScale and contentsBoundingRect
functions.

Task-number: QTBUG-32510
Task-number: QTBUG-40489
Change-Id: I660bbf394594b6ea588d4de9cc83c8c5eb28cb28
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-09-15 07:45:51 +00:00
Lars Knoll f3efdebc34 Fix typo
Change-Id: I9bfc96096ec5e2c8bd4d3c5bad13fc78ae657962
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:28 +00:00
Lars Knoll 830376c962 Rename currentExecutionContext to currentContext
Now that the other method is gone, let's use
the shorter currentContext

Change-Id: I2a6fb3b77f83a1ffdf314ad29081e303d17030ed
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:26 +00:00
Lars Knoll 0e6195a85c Cleanup usage of ExecutionEngine::currentContext
Change-Id: Ic79d6da162375928ec25871cd0341daeab6483d2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:22 +00:00
Lars Knoll df7710a205 Get rid of Scope.size
The value was only set in debug builds, but never checked
against. As this can't work with how ExecutionContexts are
now stacked, let's get rid of it.

Change-Id: I20f26afd7872a4783d163f913dde01858c3df792
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:20 +00:00
Lars Knoll 3a8d6123d1 Store the stack of executioncontext's on the JS stack
This saves one pointer per allocated execution context.
Now every execution context that is pushed, allocates two
Values on the js stack. One contains the context itself, the
other one the offset to the parent context.

Things are a bit tricky for with and catch scopes, as those
are called from the generated code, and can't open a Scope
anymore. In addition, all methods iterating over the js
stack frames need to work with ExecutionContext pointers,
not ScopedContext's.

Change-Id: I6f3013749d4e73d2fac37973b976ba6029686b82
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:16 +00:00
Lars Knoll fb059f697a Reduce usage of context->parent
Change-Id: I31bb8019783311a7e6065e2aac7fec67c1120ebf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:14 +00:00
Lars Knoll cedd732794 Explicitly push/pop ExecutionContexts
Avoid the implicit push inside the execution context constructor
and rather make this explicit in the code.

Change-Id: I1bb0fb523fddbb273fc666370d619f55f49cd40a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:11 +00:00
Lars Knoll 7dab89a65e Cleanup the ExecutionContextSaver
Always operate on the current context (as that's what we do
in practice anyway).

Change-Id: I4171207a7a86e69aa685754956c0764ac6e152a7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:08 +00:00
Lars Knoll b5902bd43a Get rid of the qmlContextObject method
Change-Id: Id8c0d9e15dd85b3818e283ab6769a49bb2e6d0f7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:06 +00:00
Lars Knoll 5dac83eb21 Remove qml context related methods from QQmlV4Function
They were only used in one place, where we can directly
call the right method on the ExecutionEngine instead.

Change-Id: I02bb16b07ef55ef66bbebb5a572cfbe27bcfcf7f
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 07:37:03 +00:00
Andrew den Exter e6b0f29159 Handle TouchCancel events in MultiPointTouchArea.
Ensure canceled has been emitted and the touch point press states have
been reset after a touch cancel event.

Change-Id: I421e8e4bdc6793b5ddc4b905ffecef91cf61ed9d
Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
2015-09-15 05:52:17 +00:00
Andrew den Exter c34d01166a Fix MouseArea stealing mouse grab after release.
This was preventing child items from receiving a release event and
making the MouseArea the mouseGrabber when the mouse wasn't depressed.

Change-Id: I93a9f4d6bd94041879ea13efda40c8d1dbb63a88
Reviewed-by: Mikko Harju <mikko.harju@jolla.com>
Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
2015-09-15 05:52:11 +00:00
Gunnar Sletta 90352aa435 Move all bools of painternode to the end as bitfields
Saves us a few bytes

Change-Id: Ie2cdda5ca0cd4a82aa00ea26e28418e6b027afac
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-09-15 05:22:27 +00:00
Gunnar Sletta 8ce5d31fdb Update QQuickPaintedItem::FastFBOResizing docs.
Change-Id: I129307816adcbddcf1cbf6013ef736c03b130f19
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-09-15 05:22:23 +00:00
Tobias Koenig 4253f11774 Implement QQmlListModel::setData()
Extending QQmlListModel by setData allows us
to modify the content of the ListModel from
within a delegate by doing an 'model.someProp = someValue'
assignment.

Change-Id: I87e4c31aca3813f099b2a4fd694beb2492a03bd0
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-09-14 15:56:16 +00:00
Liang Qi 15c7559ce1 QQuickTextPrivate: export as Q_QUICK_PRIVATE_EXPORT
Used in Label of QtQuick.Controls 2.0.

Change-Id: I68ce9f5caccc9ef090b4200f3a831eb18d9c692a
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-09-14 13:47:13 +00:00
Lars Knoll ea89d156af Fix autotests
Commit 35793cea28c4bd1d6d8fbae884d9ae3c19745c61 caused changes to
font metrics on Mac when running our autotests. This change adjust
auto tests to pass again after the change.

Fix QQuickText::fontSizeMode autotests. The calculations are font dependent,
and with small differences in the fonts between different OSes it's
difficult to find values that work everywhere.

Also fix the baseline calculations for some items that were using the
wrong fonts (exchanging empty and non empty calculations).

Fix language dependent differences on metrics calculations in
tst_qquicktextinput.

Change-Id: I7d0c7c79c8c62a4619b2f0e95ef53660b7feb782
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-09-14 12:04:32 +00:00
Laszlo Agocs 3713120cc8 Indicate that QuickTestLib is running
QTestLib already sets this environment variable to indicate that
the code is running on a test environment. Do the same for QuickTest
too.

Change-Id: I597237fcd16dc568b750bdef325881e808c407eb
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-09 17:12:23 +00:00
Lars Knoll 36d95bd2ab Remove unused variable
Change-Id: Iccdb69f7c0d24cc9ef03119092f86e711a3206af
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-09 14:28:43 +00:00
Lars Knoll f766ae49ab Smaller cleanup
Move the takeContextOwnership method over to the QmlContext.

Change-Id: I9330b31a0cb079b1c7e68a00236a69e25ed2c5af
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-09 14:28:39 +00:00
Lars Knoll 6f9a090aa5 Centralize access to qml context
Change-Id: If601262c7fd2d304491d60f63a7b9bcd4118cee8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-09 14:28:34 +00:00
Lars Knoll 1079dbbdd9 Pass a QmlContext to QV4::Script instead of a contextwrapper
Change-Id: Ia8db166aacbbe6e8f588179dffa04e2dce9566cb
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-09 14:28:31 +00:00