Commit Graph

1267 Commits

Author SHA1 Message Date
Ulf Hermann bd48f0e5ed Tooling: Convert connects to Qt5 style
Change-Id: I6746b777f73d047f5cf610bfca9b320ac1e13676
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 09:17:49 +00:00
Thiago Macieira d4a1b34e33 tst_qmlproperty: Fix access of dangling pointer
const char *name = propertyName.toLatin1().constData();

big no-no... valgrind was quite angry:

==49215== Invalid read of size 1
==49215==    at 0x4C304F2: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==49215==    by 0x5E991C5: QMetaObject::indexOfProperty(char const*) const (qmetaobject.cpp:1007)
==49215==    by 0x5ED1273: QObject::property(char const*) const (qobject.cpp:3912)
==49215==    by 0x42AAA5: tst_qqmlproperty::floatToStringPrecision() (tst_qqmlproperty.cpp:2082)
==49215==    by 0x42BB37: tst_qqmlproperty::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (tst_qqmlproperty.moc:533)
==49215==    by 0x5E9B32D: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2237)
==49215==    by 0x40434FB: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.h:123)
==49215==    by 0x403C39C: QTest::TestMethods::invokeTestOnData(int) const (qtestcase.cpp:838)
==49215==    by 0x403CE98: QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const (qtestcase.cpp:1019)
==49215==    by 0x403DF45: QTest::TestMethods::invokeTests(QObject*) const (qtestcase.cpp:1321)
==49215==    by 0x403EA9F: QTest::qExec(QObject*, int, char**) (qtestcase.cpp:1733)
==49215==    by 0x42B219: main (tst_qqmlproperty.cpp:2104)
==49215==  Address 0x155bb3d0 is 16 bytes inside a block of size 18 free'd
==49215==    at 0x4C2E38B: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==49215==    by 0x5C3F9FC: QArrayData::deallocate(QArrayData*, unsigned long, unsigned long) (qarraydata.cpp:215)
==49215==    by 0x42F2CB: QTypedArrayData<char>::deallocate(QArrayData*) (qarraydata.h:459)
==49215==    by 0x42CC7A: QByteArray::~QByteArray() (in /home/tjmaciei/obj/qt/qt5/qtdeclarative/tests/auto/qml/qqmlproperty/tst_qqmlproperty)
==49215==    by 0x42AA8B: tst_qqmlproperty::floatToStringPrecision() (tst_qqmlproperty.cpp:2081)
==49215==    by 0x42BB37: tst_qqmlproperty::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (tst_qqmlproperty.moc:533)
==49215==    by 0x5E9B32D: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2237)
==49215==    by 0x40434FB: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.h:123)
==49215==    by 0x403C39C: QTest::TestMethods::invokeTestOnData(int) const (qtestcase.cpp:838)
==49215==    by 0x403CE98: QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const (qtestcase.cpp:1019)
==49215==    by 0x403DF45: QTest::TestMethods::invokeTests(QObject*) const (qtestcase.cpp:1321)
==49215==    by 0x403EA9F: QTest::qExec(QObject*, int, char**) (qtestcase.cpp:1733)
==49215==  Block was alloc'd at
==49215==    at 0x4C2D12F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==49215==    by 0x5C3F4DE: allocateData(unsigned long, unsigned int) (qarraydata.cpp:107)
==49215==    by 0x5C3F6DE: QArrayData::allocate(QArrayData**, unsigned long, unsigned long, unsigned long, QFlags<QArrayData::ArrayOption>) (qarraydata.cpp:155)
==49215==    by 0x5C47BED: QTypedArrayData<char>::allocate(unsigned long, QFlags<QArrayData::ArrayOption>) (qarraydata.h:436)
==49215==    by 0x5C42123: QByteArray::QByteArray(int, Qt::Initialization) (qbytearray.cpp:1627)
==49215==    by 0x5D15F95: QString::toLatin1_helper(QChar const*, int) (qstring.cpp:4635)
==49215==    by 0x5D15F5F: QString::toLatin1_helper(QString const&) (qstring.cpp:4630)
==49215==    by 0x42D076: QString::toLatin1() const & (qstring.h:521)
==49215==    by 0x42AA69: tst_qqmlproperty::floatToStringPrecision() (tst_qqmlproperty.cpp:2081)
==49215==    by 0x42BB37: tst_qqmlproperty::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (tst_qqmlproperty.moc:533)
==49215==    by 0x5E9B32D: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2237)
==49215==    by 0x40434FB: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.h:123)

Change-Id: I0031aa609e714ae983c3fffd146543f79048468f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 04:17:21 +00:00
Thomas McGuire 16b680b734 QQmlPropertyMap: Don't spuriously emit valueChanged() signal
The valueChanged() signal was emitted when the property was written with
the same value. This increased the potential for binding loops in user
code.

Change-Id: Ifeb8f6f23e2022aa35cb6cac7cf1a3dbc0e8ca2f
Task-number: QTBUG-48136
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-25 16:14:18 +00:00
Nikita Krupenko dbb56ab74a Expose HSV and HSL color values to QML
[ChangeLog][QtQuick] Added properties to access color values for the HSV
and HSL color models to the basic QML color type.

Task-number: QTBUG-48723
Change-Id: I45fa52f9f3878553e1b3d0a34b47804ede7794f8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-07-25 09:31:04 +00:00
Erik Verbruggen 007ae316a6 QML: Unify property reads/writes and use accessors
Pass property reads/writes through utility functions in QQmlProperty,
which in turn will try to use accessors when available (and no
interceptors have to be called).

Change-Id: I60ecfc202b6024bfe4a33206a46299787b152546
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-25 09:26:38 +00:00
Simon Hausmann 4c1a51006e Improve robustness of qml disk caching
Perform various basic checks before proceeding to load an existing cache file,
including the qt version, architecture, data structure version and others.

Change-Id: Ie822b056e944ac120643aad260e97f62616688bf
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-07-23 05:18:59 +00:00
Simon Hausmann c016634478 Fix string property assignments to 2d vectors and quaternions
Just like it's possible to assign "1,2,3" to a QVector3D, the same
should be possible for a QVector2D and a QQuaternion.

Task-number: QTBUG-54858
Change-Id: I8f394279dcdf5c057876efaa316b4bad51a4c126
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-07-21 05:08:14 +00:00
Simon Hausmann a6b2c5100a Add support for saving/loading the moth interpreter byte code
With the JIT and moth supporting persistence, we can enable the disk
cache tests unconditionally.

Change-Id: I6d6652411237001433a32a2de21d1f78f51b43ef
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-21 04:55:52 +00:00
Erik Verbruggen 06ed1ad17a JS: Check for errors before using sub-expression results
Specifically: don't de-reference a result and assume that it's not-null.

Task-number: QTBUG-54687
Change-Id: If07d3250a95a7815ab7a3262b88e0227965ef8e7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-20 10:36:58 +00:00
Simon Hausmann 6a1667bc4e Improve robustness of qml cache expiry checking
Instead of relying on two time stamps in the file system (source file and cache
file), make the determination on whether the source file is newer than the
cache solely depend on the time stamp of only the source file. This means that
when cache files are stored in archives for example their modification date
does not need to be preserved upon extraction.

Change-Id: I0b4362663868c6fb9bd7e106028161b2d67274d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-19 18:19:46 +00:00
Edward Welbourne f23ad9d576 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	examples/quick/demos/photoviewer/deployment.pri
One side made it redundant; the other removed part of it; remove it all !

	src/quick/scenegraph/util/qsgatlastexture.cpp
One side changed a preprocessor condition, the other a code condition,
on adjacent lines; keep both changes.

	tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
One side changed a condition, the other the content of its block; keep both.

Change-Id: Idb8937f92a7edb28212449dfe0c5cfdb8e6de986
2016-07-15 21:08:50 +02:00
Simon Hausmann bf5f97e6c6 Fix alias resolution algorithm
The resolution of aliases needs to to be solved in iterations as an alias can
refer to another alias, which may not be created yet in the property cache by
the time we try to perform the resolution. Therefore the alias resolution code
works off a list of pending aliases after the initial pass of resolution. This
also requires the ability to detect circular references.

Change-Id: Id4e159b9c713aa8a8a095759e22e3fac456a38a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-15 18:51:39 +00:00
Ulf Hermann 20b96e2109 Relax QQmlProfilerService test for scene graph events
The scene graph might decide to do an initial rendering, before the
first SceneGraphContextFrame.

Change-Id: Ie6d96574b5585cfda4dcd258b6031303f9a37715
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-07-15 09:22:21 +00:00
Simon Hausmann 80a024081a Clean up implicit component registration
When assigning an object to a property that is a QQmlComponent, we implicitly
"wrap" a Component {} around the object declaration. In the QML IR this is only
half-heartedly represented. In order to correctly determine dependencies later
when saving and to support QML files that use implicit components but don't
import QtQml or QtQuick explicitly, we must also extend the file imports
accordingly. This is now done (and tested) by emulating a "import QtQml 2.0 as
QmlInternals" and then using "QmlInternals.Component".

Change-Id: I26f4f53a35675b52d4bd39f23359b0ac8f9678c5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-15 06:43:39 +00:00
Lars Knoll 91ed06b767 Fix logic bug when deleting properties of JS objects
The code used the size of the internal class in an inconsistent
way. It should simply compute and work with the old internal
class size, as that reflects the old object layout.

[ChangeLog][QtQml] Fix assertion when deleting properties of JS objects

Task-number: QTBUG-54589
Change-Id: Ie3db70437e780215d08a1a96491db75f8b859754
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-14 11:29:34 +00:00
Simon Hausmann be491913c0 Fix endian support in compiled data structures
The goal is to make the compiled data structures persistent on disk. In order
to make it possible to create these data structures on a "host" system that may
have a different endianness than the target system, we now make all the word
sized fields little-endian. The template wrappers from QJson provide
zero-overhead access for little-endian machines (the vast majority) while
maintaining a large degree of source compatibility.

Change-Id: I3d30da1fcf3bffb98dbe9337d3a35482fb7b57c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-14 03:58:57 +00:00
Simon Hausmann 28ed215281 Added two unit tests for alias nesting
The first test covers a use-case currently only otherwise see in
QtQuickControls, and so having it here allows for catching regressions in that
area before hitting the next qt5 build.

Having an alias refer to another alias property within the same file only works
if the second alias is resolved/processed before the first one. This works by
chance when relying on the order of processing reverse to the declaration, but
that's a bug. It should work regardless of the order. That is what the second
test-case demonstrates and that is why it is marked as failure.

Change-Id: Iba386437d21efa868d9814221092df5f7ef6f1f6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-07 14:38:40 +00:00
Ulf Hermann bd8cf4e040 QmlProfiler: Extend test to check for timestamp ordering
Timestamps should always increase monotonically.

Change-Id: Idfd44e160193aab7bce37b58bc42a94ff087d15e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-06 09:19:38 +00:00
Simon Hausmann 8d139e5e42 Minor optimization
I've seen people write

    property SomeItem myProperty: null

This is an unnecessary initialization that ends up creating a binding
expression. Generally there's handling missing for null and undefined, but in
this very case we should just optimize away the initializer expression,
because QObject style properties are initialized to null by default, as opposed
to undefined.

Change-Id: I7af4cd45461304753c93cef3926f6e92d3b6c95d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-27 07:39:47 +00:00
Erik Verbruggen 3dfd47362f QML: Specialize bindings based on target property type.
When we can determine the type of a target property during type
compilation, we can skip a whole bunch of code that deals with
converting the result of a binding to the correct (target) type.

This removes 65 instructions on x86 for such typed bindings.

Change-Id: Id2c7c57b9ae6dfbeb921121beae9630604ca1d17
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-27 06:20:23 +00:00
Erik Verbruggen 702c4247d7 V4: Pass scope around as parameters inside the runtime.
The implementation of many (or all) runtime functions consist of first
creating a QV4::Scope, which saves and restores the JS stack pointer.
It also prevents tail-calls because of that restoring behavior. In many
cases it suffices to do that at the entry-point of the runtime.

The return value of a JS function call is now also stored in the scope.
Previously, all return values were stored in a ScopedValue, got loaded
on return, and immediately stored in another ScopedValue in the caller.
This resulted in a lot of stores, where now there is only one store
needed, and no extra ScopedValue for every function.

Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-22 11:07:05 +00:00
Liang Qi 43431619d6 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/quick/items/qquickflickable_p_p.h
	src/quick/items/qquickpathview_p_p.h
	tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp

Change-Id: I77664a095d8a203e07a021c9d5953e02b8b99a1e
2016-06-21 21:22:46 +02:00
Simon Hausmann 7c8441fece Clean up pragma singleton handling in the type loader
Get rid of the m_isSingleton boolean by checking the
CompiledData::Unit::flags after the type compilation. This is more
compact and makes the singleton type checks independent from the IR.

Change-Id: I04189d284e6ea275ac8540918836b641914e7588
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-20 08:02:01 +00:00
Frank Meerkoetter e88500ff25 Increase test coverage for the V4 memory manager
This commit adds a small test that exercises a number of code paths
inside qv4mm.cpp which are normally gated via environment variables.

Change-Id: Ibe959387a9b86ce68df258513446d2165fe06ee2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-20 07:42:08 +00:00
Simon Hausmann 156d10e165 Clean up file/error handling in the type loader
Fold the functionality of reading QFile contents via QQmlFile into
QQmlDataBlob::Data. This reduces the dependency on QQmlFile - which is
scheduled for removal - and it makes it possible in the future to avoid
reading the file altogether if we have a cached compilation unit on
disk.

Change-Id: Ieeaf52b6fb1d25665cd3c3b196819e25aba3dd15
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-20 04:08:53 +00:00
Simon Hausmann 8a33d37006 Added basic support for saving compilation units to disk
Hidden behind a QML_DISK_CACHE=1 environment variable we will now attempt to
save a binary representation of the type compilation for Foo.qml next to it called
Foo.qmlc.

Change-Id: I27e800b50cdb186669256fd277578ea1f1e70513
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-17 09:06:01 +00:00
Liang Qi 34956bc234 Merge remote-tracking branch 'origin/5.7.0' into 5.7
Change-Id: I7b0ad528da17ecdb955c2d0c792c9f113904623e
2016-06-16 07:09:19 +02:00
Liang Qi 4d2f743baa Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp

Change-Id: I26d6435a29cac3840bb567ade5149c2562a94bf9
2016-06-13 19:06:06 +02:00
Ulf Hermann 210617de78 QML: Only release types if they aren't referenced anymore
Just checking for references on m_compiledData is not enough. The
actual component can also be referenced. Thus it won't be deleted
on release(), but cannot be found in the type cache anymore.

Task-number: QTBUG-53761
(cherry picked from commit 2ac19881f9)
Change-Id: If254d5bca1f41ec948ec1438df0d37bf8d531bdf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-06-11 12:05:08 +00:00
Ulf Hermann 2ac19881f9 QML: Only release types if they aren't referenced anymore
Just checking for references on m_compiledData is not enough. The
actual component can also be referenced. Thus it won't be deleted
on release(), but cannot be found in the type cache anymore.

Task-number: QTBUG-53761
Change-Id: I8567af8e75a078598e4fed31e4717134e1332278
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-10 19:16:45 +00:00
Laszlo Agocs c9d8b85ec9 Merge "Merge remote-tracking branch 'origin/wip/scenegraphng' into dev" into refs/staging/dev 2016-06-10 09:32:24 +00:00
Liang Qi 0932a59971 Merge remote-tracking branch 'origin/5.6' into 5.7
Part of 0e053528 was reverted in the merge, about lastTimestamp. It
will be applied later in separate commit.

qmltest::shadersource-dynamic-sourceobject::test_endresult() was
blacklisted on linux.

Conflicts:
	.qmake.conf
	tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
	tests/auto/qmltest/BLACKLIST
	tests/auto/qmltest/qmltest.pro

Task-number: QTBUG-53590
Task-number: QTBUG-53971
Change-Id: I48af90b49a3c7b29de16f4178a04807f8bc05130
2016-06-10 10:06:39 +02:00
Simon Hausmann 6d54a59bd7 Fix crash when using with statement with an expression that throws
We need to evaluate the expression for the "with" statement that is supposed to
define the new scope _before_ opening up the scope, otherwise - when the
evaluation of the expression throws an exception - we'll try to pop the "with"
scope we couldn't open in the first place.

[ChangeLog][QtQml] Fix crash when using the "with" statement with an expression
that throws an exception.

Task-number: QTBUG-53794
Change-Id: I7733f5a4c5d844916302b9a91c789a0f6b421e8a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-07 07:07:15 +00:00
Corentin Jabot 8c8ec31b7a Add QJSEngine::newQMetaObject
QJSEngine::newQMetaObject let us expose QMetaObject to the QJSEngine,
allowing to construct QObjects instance from javascript.

Additionally, enums values are exposed as property of the QMetaObject
wrapper.

(The engine takes ownership of the created objects)

Change-Id: I5428d4b7061cceacfa89f51e703dce3379b2c329
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-05 15:25:40 +00:00
Simon Hausmann 6d63e3ba09 Fix bug in SQL database integration with null values
Since commit 91d6a63ab3 a null JS value is
mapped to a QVariant(VoidStar) to properly create null JS values when
converting back again. However that broke the binding of values in the SQL
database, where it ended up mapping null to an empty string.

[ChangeLog][QtQml] Fix mapping of null JS values to null SQL values instead
of empty strings.

Task-number: QTBUG-53412
Change-Id: Icf1fea4674e9dd8bb5313e3770ed2d3f99849987
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-06-03 14:37:26 +00:00
Simon Hausmann 4018a91d2f Minor const cleanup
The unit data of QV4::CompiledData::CompilationUnit is read-only, which we
should "enforce" with a const, especially as in the future it may come from a
read-only mmap'ed chunk of memory.

Change-Id: I58dde9fe2494d3cfa52cdc9f612c7fa90b98aa26
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-03 13:24:07 +00:00
Valery Kotov a8399c5440 QML Engine: Support for "PATCH" method for XMLHTTPRequest
Support for HTTP PATCH method was added to QQmlXMLHttpRequest. Tests for
PATCH method in XMLHttpRequest were added.

[ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now
supports the PATCH method in HTTP requests.

Task-number: QTBUG-38175
Change-Id: Ib3c104b558f626bb63624e234f1362adcf6cbd4d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-03 13:23:55 +00:00
Simon Hausmann 1f3f6d3e7d Remove QQmlCompiledData in favor of QV4::CompiledData::CompilationUnit
QQmlCompiledData used to contain the binary data for instantiating QML types in
the QML VME. Nowadays the QML type compiler as well as the JavaScript compiler
create a QV4::CompiledData::CompilationUnit.

Change-Id: I155f62a5ecfb55a3fe230520231b6d8fd5b28ac9
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-06-01 17:33:50 +00:00
Laszlo Agocs 272b9a8ad6 Merge remote-tracking branch 'origin/wip/scenegraphng' into dev
Change-Id: Id0f9774dba13ccf10facc7da91b6791a96e0d778
2016-06-01 15:38:07 +02:00
Simon Hausmann 2bb309af8b Moved resolved type references over to QV4::CompiledData::CompilationUnit
Change-Id: I99bb37bf4d4aa4aedd8e02a0fb4afb4a908573a6
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-05-31 14:28:29 +00:00
Andy Nichols 91e1a65cdb Merge remote-tracking branch 'origin/dev' into scenegraphng
Change-Id: I35715e07b6f837f21cd8e8898f19d97af92c6b69
2016-05-31 12:24:30 +02:00
Simon Hausmann 7cd4d60c74 Removed the dependency to QQmlCompiledData from QQmlCustomParser
We only need fields from the compilation unit, so let's pass that instead.
This is private, internal QQmlEngine API only used by QtQml and QtQuick.

Change-Id: I1a659654d95585b736384b5b519d05a4df3f9ead
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-30 11:03:36 +00:00
Simon Hausmann e850416fcf Optimize named object handling
By storing the object indices of named objects in the CompiledData::Object of a component,
we can achieve two things:

    (1) We can eliminate the hash of vectors in QQmlCompiledData for the object-to-id mapping
    (2) We can store the mapping from object name to integer object id in the CompilationUnit and
        share it across different QQmlContextData instances (as long as it is not modified).

Also added a new test that verifies the functionality of a .qml file starting
with Component{} itself with object names, something that was previously only
implicitly tested through some of the examples (corkboards.qml for example).

Change-Id: I28c70217222dc0e5252bf5247b7e3fc4def47446
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-26 19:57:55 +00:00
Ulf Hermann 0e05352843 QmlProfiler: When flushing data, send it in the right order
Some of the adapters immediately return dataReady() when reportData()
is invoked. This means that there is only one adapter in the start
times list then, which in turn causes all the data from that adapter
to be sent at once, without caring for the other adapters' timestamps.

Change-Id: Ic1e12fdcefb0a691067518fba100368f13c927f7
Task-number: QTBUG-53590
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-05-25 14:36:57 +00:00
Laszlo Agocs 0837453ef9 Merge remote-tracking branch 'origin/dev' into HEAD
Change-Id: If91e0e28d004f1db978dcab393f189743bb69cd5
2016-05-24 21:50:29 +02:00
Simon Hausmann a681465023 Get rid of QQmlVMEMetaData
It is unused now and we can remove it as well as its QByteArray based storage.
The non-emptyness of the meta-data QByteArray was also used to indicate whether
it is necessary to create a VME meta-object when instantiating an object. This
bit is now folded into the flag of the QFlagPointer storing the property
caches.

Change-Id: I3c3604c61ff16a4e76912e68b1c19afdb0f2bd9d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-24 14:08:23 +00:00
Simon Hausmann 70c536b047 Get rid of QQmlVMEMetaData::AliasData
The remaining signal index for the changed signal of the alias target
is something that we need only once (when doing the initial alias endpoint
connection) and then we can retrieve it from the property cache.

Change-Id: Ifbd4625f9af3ca00c9b916eee5c82f58450d54ef
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-24 14:08:18 +00:00
Simon Hausmann 641beae327 Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-05-24 14:08:15 +00:00
Liang Qi 8ae479a8ea Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/qml/jsruntime/qv4engine_p.h
	src/qml/jsruntime/qv4runtime_p.h
	src/qml/qml/qqmldelayedcallqueue.cpp
	src/qml/qml/qqmlvaluetypewrapper.cpp
	src/qml/qml/qqmlvmemetaobject.cpp
	src/qml/qml/v8/qv8engine_p.h
	tests/auto/quick/qquicktext/tst_qquicktext.cpp

Change-Id: I3f0608c7beb88088cbbef4d0db59920f56deaea9
2016-05-24 14:00:39 +02:00
Laszlo Agocs 9ff09fb283 Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Conflicts:
	src/quick/items/qquickopenglshadereffectnode.cpp
	src/quick/items/qquickshadereffect.cpp
	src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
	src/quick/scenegraph/qsgdefaultglyphnode_p.h

Change-Id: I3d6874b4e4231a89d2836c04fe8e7f2ef2d698c4
2016-05-24 11:33:42 +02:00
J-P Nurmi 15b2e6da74 Use the pre-defined QQmlExtensionInterface_iid macro
The others were changed in 5.6 commit 392c7b9. These are the last
remaining occurrences in 5.7.

Change-Id: I1b17e35b0d1dda6ad598c6c30727c1728b688074
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-05-23 20:34:49 +00:00
Filipe Azevedo 82b0b31fe4 Fix crash for unknown QQmlListModel roles in debug builds
If a role is unknown, trying to access it will crash in getExistingRole.
Fixed that and now return QVariant() for unknown roles.

Change-Id: Iad5c1292a4faee893fbc5a69984cf776aca85d70
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-05-23 14:01:42 +00:00
Simon Hausmann 7f7e2b0c9c Simplify VME meta object meta-data
For each type of VME meta object we store an array of integers holding the
meta-type ids of the QML declared properties. We can replace that array with
access to the QV4::CompiledData::Property entry for each property, where the
type is also accessible.

This is a fairly straight-forward change, except for the bit in
QV4::CompilationUnit where we delay the release of the CompiledData::Unit and
friends until the destructor instead of releasing it at unlink time. That
should be a safe change and is necessary as there are a few tests around where
the VME meta object still needs access to this meta-data at a very late stage
in the life-cycle right before the deferred deletion is run.

Change-Id: I431de15d12766df837c0e0251192df16a5a76868
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-23 08:59:34 +00:00
Erik Verbruggen 607320ca9f V4: allow inlining of ExecutionEngine::{qml,js}Engine()
All other changes are just to be able to include qv8engine_p.h in
qv4engine_p.h

Change-Id: I71ba2ec42cdc20d5c7d97a74b99b4d1ada1a5ed8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-20 13:44:13 +00:00
Liang Qi 63ec33e79c Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4engine_p.h

Change-Id: I89ffccd699bee675732758d039e22224b275d60d
2016-05-19 20:41:34 +02:00
Simon Hausmann ef6469a959 VME Method object data cleanup
Get rid of the redundant MethodData meta-data that is stored per-type.

Change-Id: I9faa284bdd0c9f0c9ebb3c66905ab5e34a9ee3a4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-19 12:12:35 +00:00
Liang Qi afc84775ef Merge remote-tracking branch 'origin/5.6.1' into 5.6
Change-Id: Ib7f8c60143c1efab279476dba390a3d9837ccc37
2016-05-19 06:34:04 +02:00
Simon Hausmann 5861dc4869 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/qml/qml/v8/qqmlbuiltinfunctions_p.h
	tests/auto/qml/qqmlqt/tst_qqmlqt.cpp

Change-Id: I9dd93732f4b19513576ca1dd89ae18c69de0203b
2016-05-18 15:17:37 +02:00
Simon Hausmann 72515ebe5a Fix crashes when incubating objects asynchronously with initial properties
This is a regression from commit 94e337fa95 where
we accidentally ended up not having a calling QML context set anymore when
initializing the properties on newly incubated objects as provided by the
caller. The QML context is necessary as for example when we set a URL property,
the URL can be relative and it will be resolved to the base url of the context
when written, such as in in QQmlPropertyPrivate::write.

Change-Id: I1d896381fc92f653a7d76f4d82174bca48828f5e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-18 10:08:30 +00:00
Simon Hausmann 6371b208a9 Revert "Remove this piece of code"
This reverts commit bad007360a.

The lookup in the global object is necessary to detect whether we've seen any
unresolved properties. This is used for the optimization of skipping binding
refresh updates when a context property changes.

Task-number: QTBUG-53431
Change-Id: Idb39a32e4b58b915496bbb9d8a098dc17a6f688a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-18 07:44:45 +00:00
Simon Hausmann 1c51ae2911 Fix visibility of properties in value types
It should be possible to enumerate the properties of value types (gadgets),
in order for things like JSON.stringify(Qt.point(10, 20)) to return something
sensible.

Task-number: QTBUG-43382
Task-number: QTBUG-34878
Change-Id: I3a2c09151ebe97fd97760dfbbf5a4f58e022bc94
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-05-15 18:35:15 +00:00
Liang Qi ae745746a6 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/qml/jsapi/qjsengine.cpp
	src/qml/qml/qqmlengine_p.h
	src/quick/items/qquickanchors.cpp
	src/quick/items/qquickanimatedimage_p_p.h
	src/quick/items/qquickitem_p.h
	tests/auto/qml/qqmlecmascript/testtypes.h
	tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
	tests/benchmarks/qml/creation/tst_creation.cpp

Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
2016-05-13 08:28:27 +02:00
Oswald Buddenhagen 70d30cb2b9 prune unused assignment
Change-Id: Iecb1e9cd4d068660a96ba98480e92d9aa3981671
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-12 14:20:31 +00:00
Erik Verbruggen 28128f2dc6 QML: Fill QtObject lazily.
Only iterate over the enumerations/enumerators in the staticQtMetaObject
when a get() is done, and the key/value is not yet in stored in the
underlying Object. The whole cost of the iteration is now moved to get()
and advanceIterator(). The latter will add all items in one swoop, but
iteration over QtObject isn't used much (if at all). The get() will add
all key/value pairs up until it finds the requested key. Checking a
number of applications shows that none of them use all (or the "last")
key, so it will actually save entries (which equals memory) too.

This change reduces the instruction count for QtObject from 2.7M
instructions down to 95k. As this initialization is done from the
QQmlEngine constructor, it also speeds up that initialization.

Task-number: QTBUG-43770
Change-Id: I71331ff76bdacdd4790f7ff0430c4cbc214fe0ab
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-11 12:23:17 +00:00
Ulf Hermann f829f12d3d QmlProfiler: Don't import QtQuick if we don't use it
This enables some of the tests to run in QML-only environments, without
QtQuick.

Change-Id: Icc7250b6ddab43730cb4744ffc4e0bade8574d26
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 15:31:15 +00:00
Laszlo Agocs e3716cdf88 Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: Ifb69f73ac805afe5e3c8708fa975b7d3c13a4e48
2016-05-07 13:26:27 +02:00
Andy Nichols 928915cabe Fix some test failures with QT_NO_OPENGL builds
Change-Id: I4154084b4a0e0709ee8cb39a856a37a611e2d537
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-06 19:17:28 +00:00
Liang Qi 9b6d55ddf3 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I3c6a93917cb46868cdb9dd50566b90c70f67102e
2016-05-06 09:17:24 +02:00
Kevin Ottens 373c621bf4 Add QVector support to JS sequences
Change-Id: I731355aa1754721236f3711a65af4f96781cebc0
Task-number: QTBUG-51467
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-03 08:00:30 +00:00
Simon Hausmann 9530a6a874 Revert "Temporarily blacklist importsPath change on Windows"
This reverts commit 91a96d1de9.

I've been told that the race condition in the networking stack has been
fixed on Windows.

Change-Id: Ica038229e8e164a199332288ed140ca6a1d3104c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-02 11:43:25 +00:00
Simon Hausmann 1650377af7 Fix crash when trying to call a property of the scope or context object
For calls on properties of the scope or context object the thisObject parameter
in the callData is a reference to the QmlContext, not a real object - therefore
the toString conversion fails.

Task-number: QTBUG-52340
Change-Id: I08d01cc5c05920c2fac46ddd40fa41e630bcade3
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-01 09:08:52 +00:00
Simon Hausmann 8f7b36f899 Allow the use of uncreatable types for properties
It should be possible to write

    property SomeUncreatableType blah;

It should not be possible to write:

    property SomeUncreatableType blah: SomeUncreatableType {}

Task-number: QTBUG-36752
Change-Id: I2d1aa9f070a368f51844bbc0733d285022aab403
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-29 12:40:46 +00:00
Kai Uwe Broulik 7a0f3269b1 Add some ECMAScript 6 Number and Math methods and properties
This adds the Number.EPSILON property, the Number.isFinite, Number.isNaN,
and Math.sign methods introduced in ECMAScript 6.

Change-Id: Ib16408a63c202a4ef30a14334f65ac3a1a13cfaf
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-28 08:32:35 +00:00
Liang Qi da374438be Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/quick/items/qquickimagebase.cpp
	src/imports/layouts/plugin.cpp

Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
2016-04-27 08:47:35 +02:00
Michael Brasser 26ecc82374 Add string search functions from ECMAScript 2015.
Change-Id: I46d5e42186d9f1b2994778de967610725b0e0633
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-25 14:15:48 +00:00
J-P Nurmi 3c5e438890 Allow target path version in a parent module
For example, the QML Engine is now able to locate QtQml.Models 2.x
in both of the following target/installation paths:

- QT_INSTALL_QML/QtQml/Models.2
- QT_INSTALL_QML/QtQml.2/Models

This is required for QtQuick Controls 2. The target path of the module
is QT_INSTALL_QML/QtQuick/Controls.2. The built-in styles are installed
as sub-directories to be able to locate them from the controls module.

Some of the built-in styles provide their own C++ extensions via style-
specific imports (eg. the Material attached property is imported from
QtQuick.Controls.Material 2.0). The problem is that the QML Engine does
not find the module from QT_INSTALL_QML/QtQuick/Controls.2/Material,
but requires it to be installed outside the main controls module ie.
QT_INSTALL_QML/QtQuick/Controls/Material(.2). This makes it a) hard to
locate the styles from the main controls module, and b) conflicts with
the target path of QtQuick Controls 1.

[ChangeLog][QtQml] Made the QML Engine capable of locating QML sub-
modules from within a versioned parent module path. For example,
QtQml.Models 2.x can be either in QT_INSTALL_QML/QtQml/Models.2 or
in QT_INSTALL_QML/QtQml.2/Models.

Change-Id: I2fe4bbdd6d04dd1e80cbe9b3e7e02617658a0756
Task-number: QTBUG-52556
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-21 09:32:25 +00:00
Michael Bruning 0b7c11e7c2 Also match QJSValue conversion types in MatchScore.
This had the effect that overloaded methods were always mapped to the
wrong slot.

[ChangeLog][QtQml][Important Behavior Changes] When matching the method signature
of a invokable method to the slot in the metaobject, the matching function now
assigns the best match to a QJSValue if the parameter actually is a QJSValue. This
corrects the previous behavior, where QJSValue and int were given the same match score
even though QJSValue would have been the best match.

Task-number: QTBUG-51746
Change-Id: I906e7b006ee5af92ea760ed1625e5047aef123bf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-20 13:38:31 +00:00
Ulf Hermann 23e0e26ce6 Occasionally trim the type cache
As loaded components are kept in a cache, they are never removed by the
garbage collector. So, if you periodically create new components, they
leak. This change adds a floating threshold for the number of
components. When that threshold is surpassed trimCache() is called and
unneeded components are removed.

Task-number: QTBUG-42055
Change-Id: I30e3e4ee287f6d34376713668009c67614a50e0c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-19 08:09:21 +00:00
Simon Hausmann 490ec1ff4e Fix memory corruption when calling Array.unshift()
The dequeue offset won't wrap around when n > offset.

[ChangeLog][QtQml] Fix crash with Array.unshift()

Task-number: QTBUG-52065
Change-Id: I5e8b89ec964cd6397100442a5239254bca989a3f
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-14 13:49:21 +00:00
Simon Hausmann 8ca22ca7eb Fix invocations of methods taking a QByteArray
Since commit 3b7e2a69f7 when calling a slot that
takes a QByteArray with a parameter that is not a QByteArray, we would end up
passing an empty QByteArray. This is a regression as previously we supported
the conversion code path, i.e. when passing a QString it would be converted to
utf-8, through QVariant's conversion code path. This code path needs to be
re-activated by removing this "shortcut". The shortcut is not necessary as the
execution engine's toVariant() function also knows how to apply the conversion.

Change-Id: I0600d195c94fa4e1e0b7ab807f045f0da42f595b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-12 11:52:49 +00:00
Sebastian Lösch 392c7b9934 Instantiate static Qml plugins declaring QQmlExtensionInterface only
When instantiating static plugins no check is done whether the
QQmlExtensionInterface is declared. Therefore all user plugins are
instantiated in the Qml thread, which may cause problems.

Task-number: QTBUG-52012
Change-Id: Ia91ec5ec7b2a9721bd11e3648cdc161855b4454e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-11 14:10:54 +00:00
Lars Knoll 3057b8c7e6 Convert the remaining runtime methods to new calling convention
Change-Id: I88ad3ca430508617d527715aa85ae8474ab7c621
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-11 12:27:39 +00:00
Liang Qi b9eca979f8 Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I48c493b537e65276107ed7ee029312e294947e8b
2016-04-08 23:42:37 +02:00
Michael Brasser 1148d3acea Add delayed property to Binding.
Provide a way to avoid potentially expensive or unexpected intermediate
values.

[ChangeLog][Binding] Add delayed property to Binding as a way to avoid potentially expensive or unexpected intermediate values.

Change-Id: I6aaca570859cc1344eeb9c9f19f32660e8c0b4e0
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-08 17:12:53 +00:00
Liang Qi 68ba8fe3cc Merge remote-tracking branch 'origin/5.6' into 5.7
This change also fixes the build of two benchmarks, tst_affectors
and tst_emission.

Conflicts:
	src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro
	src/qml/qml/ftw/qhashfield_p.h
	tests/benchmarks/particles/affectors/tst_affectors.cpp
	tests/benchmarks/particles/emission/tst_emission.cpp
	tests/benchmarks/qml/pointers/pointers.pro
	tests/benchmarks/qml/pointers/tst_pointers.cpp
	tests/benchmarks/qml/qmltime/qmltime.pro
	tests/benchmarks/qml/qquickwindow/qquickwindow.pro

Change-Id: I595309d1e183c18371cb9b07af6e4681059de3b2
2016-04-08 13:03:25 +02:00
Edward Welbourne 7d7e28ce11 Purge sRGB chunks from PNG in tests.
Subjects each *.png file that matched grep -law "sRGB" to:
pngcrush -ow -brute -rem allb -reduce

Various tools grumble about sRGB tables in PNG images; and our
handling of them doesn't pay attention to these, so purging them
makes the images smaller with no loss to the images.

Change-Id: I9e4dc3aec97cd32bc8ac216fadeaf7669c49647c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-29 12:04:02 +00:00
Joerg Bornemann 7d8c941574 Remove empty .pro file
Change-Id: Ia85ced87b9cb0ad2093bdfc4abcf222929bc8bd5
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-03-24 19:40:31 +00:00
Friedemann Kleint efa9e6fe9a Remove Windows CE.
Remove #ifdef sections for Q_OS_WINCE and wince .pro file clauses.

Task-number: QTBUG-51673
Change-Id: I33ab74f0c2ce9086c3610c5fa727f281197b6b55
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-10 11:27:18 +00:00
Michael Brasser 6cc908e25b Add Qt.callLater() function.
Calling the new Qt.callLater() multiple times in quick succession with the same
JS function as argument will result in a single call to that function, thus
eliminating redundant unnecessary calls.

Based on previous patches by Mathias Malmqvist <mathias.malmqvist@nokia.com>
and Chris Adams <chris.adams@jollamobile.com>

Change-Id: Ie71b60d4d48fa73d3deae723775cf36662d199ae
Task-number: QTBUG-22400
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-08 16:45:39 +00:00
Nobuaki Sukegawa 3b7e2a69f7 Convert QByteArray in C++ type to ArrayBuffer in QML and vice-versa
Change-Id: Ie4e29a443a17826a3ce4d1e1912bd35dc497ac78
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-05 08:26:29 +00:00
J-P Nurmi 23712c5680 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro

Change-Id: I3ca8f0422828191b7e19539c25f31f2d048e9f18
2016-03-01 14:17:52 +01:00
Thomas McGuire 029003851b Properly signal errors when accessing lowercase enum values
Task-number: QTBUG-46758
Change-Id: I14e394021c231bda5552c8d1c98f20c903a62f12
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-24 12:11:27 +00:00
Nikita Krupenko d3f8a608e8 Validate Binding only when it is enabled
Not validate binding if it is disabled and validate when it became
enabled. This helps to get read of warnings about not existing property
that started to appear since 61ce37de40.

Task-number: QTBUG-48623
Change-Id: I4aa92896c04b146a79e606842c1d33661b3f5a70
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-02-24 10:44:01 +00:00
Liang Qi 4e7f570f92 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/quick/items/qquickitem.cpp
	tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
	tests/auto/quick/qquicklistview/tst_qquicklistview.cpp

Change-Id: I3cf47faa2fe567d62fffd985aeecbefe5811cc42
2016-02-19 12:59:04 +01:00
Simon Hausmann d444d21a51 Fix crash in Installer Framework when used with Qt 5.6
IFW uses QQmlV4Function in a QJSEngine environment, so there is no QML context.
Up to commit cc98678f40 that would work. Let's
fall back to the root context as scope if we don't have a qml context.

Change-Id: Ib240746a95a0d16d61620f97abc31e4c74f36723
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-02 13:08:51 +00:00
Liang Qi 1e421097f0 Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Iec1b2de53c275996364c4bab0123ccb3e6e9895e
2016-01-29 13:01:22 +01:00
Erik Verbruggen afbfdcff3b QML: do not wrap property values of type QVariant.
When reading a propety from a QGadget or a QObject, the values are
stored in a QVariant and later unwrapped/converted to the correct
JavaScript type. However, if the property value is a QVariant, it does
not need to wrap it (again) in a QVariant.

Change-Id: I633d3194f82b6032fc15d9994c4dee5e5609fd21
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-27 12:17:53 +00:00
Lars Knoll e9a6c1d4e3 Don't check for revisions when assigning to grouped properties
This leads to wrong behavior in some cases, where we reject
valid revisions, and there is probably no case, where this could
lead to a conflict for the user of the API.

Change-Id: I1614332cf4c07c6a227551612331dd69b2ae71f3
Task-number: QTBUG-40043
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-27 12:15:53 +00:00
BogDan Vatra b83b358634 Fix don't delete singletons objects owned by C++
Don't delete singletons objects that are created only from C++ and
have explicitSetObjectOwnership flag set, explicitSetObjectOwnership
flag is set only by QQmlEngine::setObjectOwnership.

Task-number: QTBUG-49865
Change-Id: I0ef658c2094e67b5cd9a1585e273144dfcee736a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-25 12:37:19 +00:00
Kevin Krammer d6c5c3b529 Pass Qt.include() URLs through the URL interceptor if present
JavaScript files loaded by the Qt.include() function did not get
passed through the QQmlEngine's URL interceptor, while those loaded
by import statements did.

Now both include variants have the resolved URL passed through
the interceptor, e.g. an installed QQmlFileSelector

Task-number: QTBUG-50483
Change-Id: Ife75e6b644687f3fb04048a311e570cdcbab8c6d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-23 13:09:48 +00:00
Simon Hausmann 60d27c228e Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-22 14:30:58 +00:00
Ulf Hermann ccaa12c225 Leave out most of tst_qqmlvaluetypes::locale() on QT_NO_IM
We cannot get an input method from QQmlGuiProvider then.

Change-Id: I8d9c2323b8a18a00bc44fc0121ddefb90253228a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-22 14:28:53 +00:00
Simon Hausmann f286db98ee Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I4af0bf8ec1569097d97f8ce0bb8bf1a0e4a989ec
2016-01-22 15:21:06 +01:00
Ulf Hermann b60a5dc940 Clean up QV4DataCollector
We don't need to pass debuggers and engines around as the data
collector already has all the necessary information. Also, the
exception collect job is only used in the test case, so we don't
need to define it in the collector.

Change-Id: I3197dd5c2d99e95465aa787097c6f8bf8aee794e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-22 09:51:40 +00:00
Ulf Hermann 5537027094 V4 Debugger: Avoid looking up values in debugger thread
To avoid interaction with the engine from the debugger thread we
move the value lookup functionality into the data collector, and
drop the RefHolder. Also, we define some more debugger jobs to
move the work the request handlers do into the GUI thread.

Task-number: QTBUG-50481
Change-Id: Ia73ebd01e715f13110ef010a766e9b0a1e202df9
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-22 09:51:37 +00:00
Ulf Hermann ce093497f2 Clean up QV4DataCollector
We don't need to pass engines around as the data collector already has
all the necessary information. Also, the exception collect job is only
used in the test case, so we don't need to define it in the collector.

Change-Id: I9e9f092a10295e3dc970f7b5f440e8f242ea1d54
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-21 14:49:43 +00:00
Ulf Hermann ebb08ee84e V4 Debugger: Avoid looking up values in debugger thread
To avoid interaction with the engine from the debugger thread we
move the value lookup functionality into the data collector, and
drop the RefHolder. Also, we define some more debugger jobs to
move the work the request handlers do into the GUI thread.

Task-number: QTBUG-50481
Change-Id: Id93548dc65133246deac71f73188c715e9dc01e4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-21 14:49:39 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Jani Heikkinen cb5054ec8a Fixed qtdeclarative tests to pass with updated license header
Change-Id: I3c826a7b3ee9ff66fac89a7a3d6f0e7057f03eed
Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
2016-01-20 11:46:18 +00:00
Marco Benelli c1bdf81549 qmlplugindump test: added check.
Added a check on meta object revisions, in order to verify regressions
on QTBUG-49284.

Change-Id: I616875157d2b36db0a984338ba9d6a7c5a83a240
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-01-18 12:31:37 +00:00
Ulf Hermann 258638f372 Rewrite inspector service
The inspector service had bitrotted to a point where there was little
code to be rescued. Apparently it was never really finished and quite
some code didn't make any sense. This change removes some features
that were unused or didn't work correctly:

1. Panning and Zooming with mouse wheel and touch interaction. This
might be useful in some contexts, but the implementation was so broken
that it wasn't worth trying to fix it. The whole idea of doing this on
the layer of QQuickItems is not so great because there is no
distinction between spontaneous changes triggered by the application
and debugging interaction triggered from outside. It might be better to
implement such functionality on a lower level, e.g. in the renderer.

2. Reloading the scene with debug changes. Use one of the other debug
services to change properties. Clearing the component cache is a rather
drastic measure and not necessary here.

In turn, we get support for inspecting multiple windows, and all
subclasses of QQuickWindow are supported now. Also, show-on-top works
now.

Task-number: QTBUG-33376
Change-Id: I65497f49c6b46128a600b0e3a31483eeef40313c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-12 18:00:47 +00:00
Ulf Hermann 11bd376d13 Make environment for QQmlDebugProcess useful
We don't want to replace the system environment, but rather add to it.

Change-Id: I0a498682f8f70dc349c529fa4fc3d76ccb815af8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-11 17:31:53 +00:00
Ulf Hermann dd37ea8580 V4 Debugger: Move all the jobs into one place
This makes the code more readable and allows us to keep the data
collector as value, rather than pointer, in QV4Debugger.

Change-Id: I2939c2b2f551111139f1dc34704a6029e87a66bf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-11 09:46:41 +00:00
Ulf Hermann b6ca444408 V4 Debugger: Clean up tests
Now that we can evaluate expressions without pausing, we might as well
test for that. The race conditions should also be resolved by now.

Clarify the reason why the break-on-attach test cannot work (so that
whoever tries to fix it the next time doesn't have to figure it out
for the (n+1)th time) and remove some dead code.

Change-Id: Ib1aab03d40779c6876db914b852f05061a2be046
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-11 09:46:35 +00:00
Liang Qi 6c090cd8d0 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h
	tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
	tests/auto/quick/qquicktextedit/qquicktextedit.pro
	tests/auto/quick/qquicktextinput/qquicktextinput.pro

Change-Id: I95d2c20a8619e5b8fa361c941a16dd8dce3e04e7
2016-01-10 20:45:46 +01:00
Ulf Hermann eae5a20b09 V4 Debugger: Allow expression evaluation without pausing
We can schedule jobs into the GUI thread just fine, even if the
debugger is running. They will run in global scope then. The only
restriction is that we need exactly one engine to be running in order
to do that, as otherwise we cannot decide which engine to use.

To avoid interaction with the engine from the debugger thread we
move the value lookup functionality into the data collector, and
drop the RefHolder.

Change-Id: Ifae124d70f42e488ed9a1b6794baef638992ddb1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-07 16:25:12 +00:00
Ulf Hermann 881bb537c9 Make RuntimeHelpers::numberToString() comply with EcmaScript
We could use DoubleToStringConverter::EcmaScriptConverter().ToShortest()
here, but we'd have to #ifdef it for the case that we're using the libc
double conversion. As the formatting does not produce a lot of code I
decided against that.

Task-number: QTBUG-50131
Change-Id: If7a2ef8063b57ab35cda4a60d8ddd65442d70103
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-05 11:36:57 +00:00
Frank Meerkoetter a4b2fa94d2 Fix value changed logic for ValueTypeProvider types
Fix broken value changed logic for types implemented
through the ValueTypeProvider interface (QtQuick and Qt3d).
It affects vector2d, vector3d, ...

The signal was not emitted for the cases where the new value
was equal to the default value of a given type.

Also add a unit test to cover this area.

Change-Id: I9491b0462c78fecc4c704ea36921611c1bd6b2ee
Task-number: QTBUG-50204
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-04 09:56:17 +00:00
Liang Qi 9f38956fc9 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	tests/auto/quick/qquicklistview/tst_qquicklistview.cpp

Change-Id: I9588a3e2c7d590e031dd4c66905a79f0d74d3ac8
2015-12-18 19:17:30 +01:00
Andy Shaw caa0a639e7 Rearrange the import paths so the qrc one is after the application path
By moving the qrc import path to be after the application one we ensure
that when the application starts up it will look for the imports in the
same way as it would both on deployment and development machine. This is
particularly important when building Qt statically because it should be
looking for the imports inside the resources.

Change-Id: I81f1b7e96c0f9df3671249668accad7adfd00df4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-17 15:08:24 +00:00
Marco Benelli 4b018848f7 qml: preserve composite singleton types.
Composite singleton types used to always have version -1,-1; regardless
of what is written in qmldir.

Change-Id: Ia193e73695e57095f6a09b97768805f2f23cd56a
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-12-17 14:06:47 +00:00
Ulf Hermann 2177fb44ea Replace all occurrences of qSNaN() with qQNaN()
We generally don't want to produce signalling NaNs as those cannot be
used in any further arithmetic operations.

In particular -(qSNaN()) claims it's not a double.

Task-number: QTBUG-49753
Change-Id: I23cec4fec2ddf08c02a7d53db7f3b9ba46b6c288
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-12-07 13:44:07 +00:00
Liang Qi 4ab7deb923 Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Ica75a71062d0613e415f2433c5c22c2e251b37cd
2015-12-07 13:20:36 +01:00
Ulf Hermann c3f03bbff1 Support multiple QML engines in V4 debugger
Whenever the debugger is paused, there is exactly one engine that
caused the debuggerPaused() slot to be called. We can only interact
with that engine in any meaningful way.

Of course you can shoot yourself in the foot with this tool. You can,
for example, set a breakpoint that will be hit by multiple engines and
then get confused about which engine just hit the breakpoint. Similar
things are also possible with other kinds of debuggers, though. If this
becomes a problem we can add an engine ID to the responses.

Also, this does not fix the other debug services. So you might still
not see the "correct" locals and expressions from the
QQmlEngineDebugService while the debugger is not paused.

Task-number: QTBUG-49615
Change-Id: Ie044f0aedb51481c4cf851635d7c12839251cbd0
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-12-02 14:11:25 +00:00
Lars Knoll 41b5175f26 Fix test cases
This test case changed after change 2e00500b9f32f25a15563a4fd35375ead12c14a7
got merged into qtbase. With that change, colors with alpha components
will now be converted correctly to a #AARRGGBB string.

Change-Id: I8a1edc846537bf7868ba56d819d7aedae1a10fa1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-01 10:54:34 +00:00
Ulf Hermann c8b4e0ae14 Remove libdouble-conversion
We can use facilities in qtbase to convert doubles to strings now.
This also makes the fix to QTBUG-47070 obsolete.

Change-Id: I2f813164ff788b96281c3ffd37d8d2c65665de80
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-23 21:15:11 +00:00
Ulf Hermann fee44872dc Extend QDebugMessageService
Add category and timestamp, and allow synchronizing the timestamps with
QQmlProfilerService.

Change-Id: I8dc67e43e1087e231167fc4cfdfb5f659e00c5b2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-17 18:42:56 +00:00
Ulf Hermann ec88ecf42b QmlDebug: Move EngineControl client to qmldebug
Change-Id: Ia2e01b3acb8e0dab19b67dd612e6228d13b4755d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-17 18:42:34 +00:00
Ulf Hermann 75b6da3c00 QmlDebug: Change "macx" to "osx" in tests' .pro files
"macx" is deprecated.

Change-Id: Iefdd1aab8a221e39f0651368fd132a842210f58a
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-17 18:42:24 +00:00
Ulf Hermann d3c3f026d3 Remove extra copy of connection from engine debug client
Change-Id: I8e6df629f2be5af9b5058e542980753b9a9053cb
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-17 18:42:13 +00:00
Ulf Hermann 0b67dd7e13 QmlDebug: Restructure QPacket and QPacketProtocol
We cannot use the same data stream version for the client and server
versions of QPacket and QPacketProtocol should not deal with QPackets
but with simple byte arrays because the underlying QDataStream is hard
to copy.

The new QQmlDebugPacket picks its data stream version from
QQmlDebugConnector now, which adjusts it when connecting. As there can
only ever be one QQmlDebugConnector, we can keep the version static.

The clients need to query the connection for the correct version. We
may connect to several different servers sequentially or we may have a
server running while using a client, and we don't want to confuse the
versions between those.

With this in place, all remaining occurrences of QDataStream are
replaced with QPacket or QQmlDebugPacket.

Change-Id: I3f6ba73fcbfad5e8df917c5feb9308116738a614
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-17 18:42:07 +00:00
Liang Qi f2244103ff Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	tools/qmlprofiler/qmlprofilerclient.cpp

Change-Id: I1de8832fefd0e45fea16ca072b6c7ae44fa376d4
2015-11-03 13:27:13 +01:00
Ulf Hermann 164af37710 Load component synchronously in method_createQmlObject
setData() is not guaranteed to synchronously load the type. In
fact, most of the time, it doesn't. However, by adding a private
Synchronous mode to QQmlTypeLoader we can prefetch the type
synchronously and then inject it into the component.

Task-number: QTBUG-45418
Change-Id: I640f12ad20c01b778b5bc41f43574d8aea504195
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-03 09:00:11 +00:00
Ulf Hermann 57430b2bda Move QML profiler client to qmldebug
Change-Id: I506909b68be6cbad631d1645673c2d38460aed33
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 20:07:53 +00:00
Ulf Hermann 79ed2f70f0 Move QQmlDebugClient into separate static library
Change-Id: Ib3daf9da2cf6798bd022cfcf54d11e565c9cb4ca
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 19:05:07 +00:00
Ulf Hermann e1db5c6607 Move V4 debugger and its test into better places
Now that we have an abstract base class we don't need to carry the
V4 debugger in QtQml anymore. The test clearly belongs into the
debugger category.

Change-Id: I0f71bdb331da8a568e43600363a0468299aa1a87
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 19:05:00 +00:00
Erik Verbruggen 9730574818 QML: Fix typeof context property.
This was missing from f21e8c641a.

Task-number: QTBUG-48524
Change-Id: I5cc6a979d965a1ef6b7fbc916a7ca9df868b459a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-27 13:17:33 +00:00
Liang Qi 3832b1e05b Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	tests/auto/qml/qml.pro
	tools/qmlprofiler/qmlprofilerclient.cpp

Change-Id: Id47f15a5ab38f8ec79f0a26c92805acba62caac4
2015-10-26 13:42:08 +01:00
Sérgio Martins 5c53861cce qmllint: Add unit-tests
Change-Id: Ia3eb33e89597e3811112ce78d8a59a822cc9190c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-25 21:48:21 +00:00
Ulf Hermann b103f6a6b9 Merge remote-tracking branch 'origin/5.6' into origin/dev
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
	src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp
	src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h
	src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
	src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
	src/qml/debugger/qqmldebugserviceinterfaces.cpp
	src/qml/jsruntime/qv4debugging_p.h

Change-Id: I82a4ce1bcd4579181df886558f55ad2b328d1682
2015-10-22 13:07:11 +02:00
hjk dd8f370cfa QmlDebug: Add a debug service for use with native debuggers
This service provides information about the state of the
most recently used QmlEngine in a way that can be integrated
with "native" debuggers (GDB, LLDB, potentially CDB).

Unlike the existing QV4 debugger service, the data extraction
is triggered by direct calls from the native debuggers, i.e.
has the examined QmlEngine stopped at the time of inspection.

Since roundtrips through the native debuggers are expensive,
an additional goal is to minimize roundtrips.

Change-Id: Ic420129bbc15162197e35b52d92e882c027c9f6d
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-10-16 17:32:06 +00:00
Ulf Hermann 5c64391fb4 Only set V4 debugger when service is enabled
Otherwise different debug services could steal each other's debugers.

Change-Id: Ic0a50333d21c7d20a7124240ea598f8446400ae3
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-10-15 17:11:50 +00:00
BogDan Vatra 6fc1e0fc36 Don't delete singletons objects owned by C++.
This way we can enable the usage of a single singletons in both
worlds. Currently singletons are destructed before the other QML
types, and using a singleton that is owned by C++ we don't need
to care about the destruction order anymore.

Change-Id: I120fcb8659e16321ae6e70c7b0d62be3bc650d73
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 16:32:30 +00:00
BogDan Vatra 5b726c3135 Align QQmlVMEMetaData to int.
Task-number: QTBUG-48139
Change-Id: I12bec1ec72a99de0c3f5b4b12d22fba2b66c8f49
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 11:15:54 +00:00
Ulf Hermann 2f03049d4c Put QPacketProtocol into its own static library
We need it in 3 places in qtdeclarative and we could also use it in
QtCreator. We don't want to bundle it with the debug client code as it
is also necessary for the server.

QPacket replaces QQmlDebugStream as it has the same purpose. This
also fixes the inconsitent handling of data stream versions.

Change-Id: I650fae353f267511c551b427d9169f4d718aa7f2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 08:23:15 +00:00
Ulf Hermann 1a123472ba Test enabling/disabling of combinations of debug services.
This tests the new QQmlDebuggingEnabler::setServices() method.

Change-Id: I29b588fa425a8e3230c451d6ff73a1bde104bfc4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 08:20:50 +00:00
Ulf Hermann 36cbf6a62a Properly test services arguments for QQmlDebugServer
So far we have only tested that each service is still functional when
the services:<service> argument is given on the command line. This test
checks that services which aren't specified are indeed not loaded.

Change-Id: Ica935da0337b2215898f65cf283d6e11365432a8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 08:20:41 +00:00
Liang Qi 7063fefe4b Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I11ea57222ba5aa683b7bfd7735fbc1d2cf86e875
2015-10-14 15:48:12 +02:00
hjk 23f3fcbabc QmlDebug: Split QV4::Debugging::Debugger
... into a pure interface and a QV4::Debugging::V4Debugger implementation.

This is in preparation of a second implementation of this interface
to be used with 'native mixed' debugging.

Change-Id: I3078dcfe4bdee392a2d13ef43a55ca993e7b88d8
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-10-14 13:38:07 +00:00
Ulf Hermann 35da68a15c Provide a threaded TestHTTPServer
This allows us to do blocking operations that interact with the test
server in the main thread. The threaded server is used in tests that
don't explicitly require asynchronous operation.

Change-Id: Ibcb28e79a1114cb9cfb812e86aae0a1af71c569e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-14 08:03:38 +00:00
Friedemann Kleint 0f5a721761 Tests: Fix single-character string literals.
Use character literals where applicable.

Change-Id: Ib0e618752fbc762a73a0a91c43efab61ef2c9687
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-13 14:24:16 +00:00
J-P Nurmi 8e7d1a9119 Make QML composite types inherit attached properties
Change-Id: Ic06af4805da987dd08e361f2668e7a1788d3eefe
Task-number: QTBUG-43581
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-09 13:06:35 +00:00
Friedemann Kleint 933cff33cb Add missing "We mean it" comments to private headers.
Task-number: QTBUG-48594
Change-Id: Ifc207938de7f0c8995fc712df92665f222612647
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-10-06 15:39:36 +00:00
Edward Welbourne c5dcabeb6a Purge spurious execute permissions.
JavaScript, README and QML are not meant to be run from the shell.

Change-Id: Ia1ddf621e2e341639daac651e2b4954364407574
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-30 18:26:13 +00:00
Liang Qi f9ef039ad9 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/qml/debugger/qqmldebug.cpp

Change-Id: I93de5a81b18cdece475870cf7cfba1b9baef2304
2015-09-25 20:56:51 +02:00
Lars Knoll f01bfcf8ed Cleanups to property allocation in the VMEMO
There's no need for a separate propertiesAllocated bool,
we can keep that state in the WeakValue itself.

Change-Id: Ife0f517bee9bc5830680eec68983767379a3c2cf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-25 18:53:17 +00:00
Mitch Curtis 9d58167d35 Add extension API to QJSEngine
This allows users in a JavaScript-only environment to install extensions including:

- Translation functions (qsTr(), etc.)
- The console object (console.log(), print(), etc.)
- Garbage collection functions (gc())

This deprecates installTranslatorFunctions(). This API results in less
clutter in the API, as we'd otherwise need to have several functions
for each type of extension.

[ChangeLog][QJSEngine] Introduced an extension API that allows
installing various function and object extensions (qsTr(),
console.log(), etc.) to QJSEngine.
[ChangeLog][QJSEngine] installTranslatorFunctions() was deprecated in
favor of the new extension API (see installExtensions()).

Change-Id: I4d6eb2097c3eda6810e967b2e8f6441c28c91a16
Task-number: QTBUG-40772
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-25 14:26:43 +00:00
Ron Hashimoto c47dacde0b V4: Fix SparseArray::deleteNode
SparseArray::deleteNode should modify size_left only if
the deleted node had a right child

Change-Id: I0f3504a5c6568dbd9e392bf83eaf3f9780eb2b84
Task-number: QTBUG-46022
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-25 08:39:46 +00:00
Tobias Koenig 61ce37de40 Improve warning for QtQml.Binding
Print a warning if there is no property with the given
name of the specified target object, or the property
is read-only.

Change-Id: I5dc2e8330fb1ce53be396b7bf5baf13c1702d2f4
Task-number: QTBUG-39243
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-24 11:11:54 +00:00
Ulf Hermann a9276971aa Use V4 double-to-string conversion instead of QVariant's
V4's version makes an effort to find the shortest possible
representation, which QVariant doesn't do.

Task-number: QTBUG-47070
Change-Id: I49ce130020496592325074e0db29a6984ee7649a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-23 07:46:35 +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
Ulf Hermann c47d865cb2 Re-enable QDebugMessageService test
The lines were wrong and the signal handling was flawed. Otherwise the
test works fine.

Change-Id: I818fd3ec92b3413c938ee125a3bb2662cd71faa1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 08:27:48 +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
Dan Cape 49c359dd88 Add enabled property to the QML Connections element
Now allows a quick way to enable/disable the signal handlers in the
QML Connections element. Updated test file to have objectName and added
test for this new functionality. Set to be available as of QtQml2.3.

[ChangeLog][QML Elements] Allow enabling/disabling of connections established using a Connections element

Change-Id: Ib0de2b3c78bb529ef74d5b4bb4ccb0f335cc50de
Task-number: QTBUG-36350
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2015-09-09 12:52:05 +00:00
Lars Knoll 948bcdbc01 Move createQmlCallableForFunction out of the binding wrapper
It's now QV4::FunctionObject::createQmlFunction, which I
believe is a better place and name for the method, esp.
as it has no real connnection to the binding wrapper anymore.

Change-Id: I59e20e120db72e53735b3a986e0b91bc7c3347d7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-08 18:33:59 +00:00
Liang Qi 68607aeeeb Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Id27c36e55fcc68cc1140b0d9bec00b8ae6b52ed0
2015-09-06 10:39:51 +02:00
Friedemann Kleint a719e348d2 Remove CONFIG += parallel_test.
The keyword no longer has a meaning for the new CI.

Change-Id: I699f2881e291cce02a6a608a8710638886e38daa
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-05 10:18:50 +00:00
Friedemann Kleint 7ea2bb8764 Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.
Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-09-03 19:23:46 +00:00
Simon Hausmann 91a96d1de9 Temporarily blacklist importsPath change on Windows
The test started failing with no changes in declarative, so the best theory at
this point is a networking related change in qtbase.

Change-Id: If361253847d781126d3877080648f5ccc07808cd
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-03 11:35:05 +00:00
Simon Hausmann 149ece7a0c Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: Ibc7a47f7ce6d15dff79fdc59f8ded297d1b8d50d
2015-09-02 17:19:48 +02:00
Mitch Curtis d1b2051379 Don't consider QLocale a value type.
This fixes a regression where all of the properties of
Qt.inputMethod.locale were undefined.

Change-Id: Id33890a78296709baad6aeda96d74ca8cb39c61d
Task-number: QTBUG-47916
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-02 13:35:03 +00:00
Friedemann Kleint 06f11da5e1 Tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.
Fix usage of API that is marked deprecated.

Change-Id: Ia887437f99b9ce207891ca19bc49294acb7d629d
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-09-02 04:19:22 +00:00
Julien Brianceau 1faca908dd XHR: Server side errors are not network errors
XMLHttpRequest specs state that only 'network errors' should result
in a request error, and a server side error like HTTP 500 Internal
Server Error (which results in QNetworkReply::InternalServerError)
is an indication of the HTTP server response rather than a network
error.

Change-Id: I94bf678a8487e3d31007dc5119d6fb4e87ea3102
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Valery Kotov <kotov.valery@gmail.com>
2015-08-27 14:08:00 +00:00
Lars Knoll c962f3c8e8 Fix autotest
The test was not getting a new warning as assumed, but still
reading the old warning from a few lines before. This mirrors
the intended behavior.

Change-Id: I7211923e378db34cdc5f8c1c78f3cfb1bea548d2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-25 03:45:36 +00:00
Simon Hausmann c907eb1b5b Fix use of function expressions with signal handlers
Writing

    onClicked: function(mouseEvent) { ... }

would get silently "accepted" by the engine, but it wouldn't do anything. We
basically wrapped it in a new function, so that it became

    onClicked: function(mouse){ function(mouseEvent() {} }

which is a noop. With older versions this used to produce a syntax error.
However the better fix is to simply support this kind of assignment for more
expressive signal handlers, because now the names of the signal parameters can
be explicitly named (with names of your choice).

Change-Id: I96369f8805fab97509784222f614ee17cf681aba
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2015-08-24 08:12:47 +00:00
Lars Knoll 88cc9b2334 Cleanup qmlcontextwrapper usage in XHR
Get rid of the static getContext overload and
simplify the signature of the dispatchCallback
method in XHR.

Get rid of the m_me object, and instead store a
pointer to the thisObject and the context data
directly.

Turn all internal errors into assertions.

Change-Id: I5427b2009c64f54b67cce1c130eace47201624bd
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-20 20:01:29 +00:00
Lars Knoll fec775d221 Hold a pointer to the QV4::ExecutionEngine in the property cache
This makes more sense than a pointer to the QQmlEngine.

Change-Id: Ic6037b0df63b6cf1585539bc3ac78822f0e69d02
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-19 11:38:31 +00:00
Ulf Hermann 8fe2e6795d Clean up data format for V4 debug connection
This changes the type announced for functions to the actual JavaScript
type "function".

The type for null is also wrong: it should be "object". However, older
QtCreators cannot distinguish between null and {} if null gets the
correct type, unless you explicitly compare x === null in an expression
evaluator. For this reason the fake "null" type is kept for now.

Also, the value field of undefined is now set as QJsonValue::Undefined
which causes it to be omitted when sent over the wire. This is the
logical thing to do.

In addition we add type and value fields for all data members mentioned
in a response, not only the ones specifically asked for. The value
field is the actual value for any primitives (including strings), or the
number of properties for composite types: objects, arrays, functions. In
turn, the "ref" members are omitted for primitive types, so that we
don't have to hold references to them in the debug service anymore. Even
old QtCreators can deal with verbatim data members without "ref".

Task-number: QTBUG-47746
Task-number: QTBUG-47747
Change-Id: I773e6418c39cd9814aadb5fb5ef7e109f9a4e618
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-19 11:28:32 +00:00
Lars Knoll 7fccfc4663 Fix test case
After the latest changes to the VMEMO, JS declared properties
will not be available after the engine is deleted.

Change-Id: Ifc6034bd0dff18d26863ca9bcf7a19e1c7d68ff6
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-18 20:27:17 +00:00
Lars Knoll 6cd0001054 Get rid of special handling of var properties
These can be handled in a simple way now by using a special
propertyType value indicating that we have a var property.

Also remove the additional write calls in the different
readProperty implementations. If the stored data doesn't
match, we can simply return the default value directly.

Change-Id: I3823a971df24bd78f0acdc4c0042776277b3c55f
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-18 20:27:11 +00:00
Ulf Hermann eb30e3d7ee Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	src/qml/debugger/qv4debugservice.cpp
	src/qml/jsruntime/qv4value_inl_p.h
	src/qml/jsruntime/qv4value_p.h
	src/qml/memory/qv4mm.cpp
	src/qml/memory/qv4mm_p.h
	src/qml/qml/qqmlnotifier_p.h
	src/qml/qml/qqmlproperty.cpp
	src/quick/items/qquickflickable.cpp
	src/quick/items/qquicktextedit.cpp
	tests/auto/quick/qquickwindow/BLACKLIST

The extra changes in qqmlbinding.cpp are ported from changes to
qqmlproperty.cpp that occurred in parallel with writeBinding() being
moved to qqmlbinding.cpp.

Change-Id: I16d1920abf448c29a01822256f52153651a56356
2015-08-18 10:29:47 +02:00
Ulf Hermann fbdc01f141 Allow specification of loadable debug services via command line
We don't want to load the debugger when profiling and vice versa. This
makes it easier to prevent unwanted services from getting loaded.

Task-number: QTBUG-47623
Change-Id: I28893b6218110274a6d30b27805d89dbb443add3
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-08-13 08:30:47 +00:00
Ulf Hermann a2ccdd3388 Move DataCollector into debugger plugin
The data collector and all the jobs it uses to interact with the engine
are only used from the debugger plugin. We can as well move them there.

Change-Id: Ia48251f08b48c7e1e607b8ae2a3d1de29f80f742
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-08-10 10:05:14 +00:00
Ulf Hermann bf5db2bbc1 Move V4 debugger agent into the debugger plugin
The debugger is the only thing that actually needs it. Note that for
this to work we need to make QV4::Debugging::Debugger a QObject and
add some signals. The net effect is still a reduction in binary size
of about 1kb.

Change-Id: Ibecb8cfa140fc26fc13c8cbefb3d027ebdcd28a4
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-08-10 10:05:09 +00:00
Ulf Hermann dc341e6c1c Change data collection for debugging to use QV4::Value.
This patch changes the variable collection to store QV4::Value values
into a JS array, which is retained by the collector. This prevents any
GC issues, and gives a nice mapping from handle (used in the debugging
protocol) to JS value. It also allows for easy "shallow" object
serialization: any lookup can start with the QV4::Value, and add any
values it encounters to the array.

Testing is changed to use this collector directly, thereby testing the
class that is actually used to generate protocol data.

Task-number: QTBUG-47061
Change-Id: Iec75c4f74c08495e2a8af0fedf304f76f8385fd7
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-08-10 10:05:01 +00:00
Lars Knoll 9100b85cc5 Don't call the test method assert
Mac OS X apparently uses a macro for assert(), completely
breaking compilation of this file

Change-Id: I51379da6e0c702e4d021dcd9a84af39889d24c2d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-09 23:06:01 +00:00
Lars Knoll 6503b4924f Prospective build fix for autotest on mac os x
Change-Id: I6b3182ed8b59e889fd11da08d8240ee5cf7d0e91
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-09 23:05:51 +00:00
Ulf Hermann 4e6de08ba1 Periodically flush profiling data to client.
This reduces memory usage as the data can be deleted once it is sent.
It also reduces the time it takes to transmit the data when profiling
is stopped. It does incur a runtime cost as the sending now takes place
while the application is running. The decision to periodically flush or
not is left to the client, who can specify a flush interval when
starting profiling.

Usage of the flushing feature also relaxes the guarantees regarding the
sorting of events before they are sent. Events with higher timestamps
are now allowed to arrive before events with lower timestamps. Any
clients implementing the flushing need to take this into account. This
will eventually allow us to do away with the server-side ordering
altogether.

Task-number: QTBUG-39756
Change-Id: Idaf4931dc17f224c2bd492078b99e88b1405234e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-04 13:34:22 +00:00
Ulf Hermann cc3a57861d Use signal/slot for passing messages through QQmlDebugServer
This results in much cleaner code than the previous implementation
using QMetaObject::invokeMethod().

We have to use read locks now for adding and removing engines, as we
should have done already before. If a condition is waiting on a write
lock you cannot acquire a read lock from another thread. So, if we kept
the write locks we wouldn't be able to receive messages while the engines
are waiting.

Change-Id: Icfe641601dec2f8d7181ae579146ed603d57a4c2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-31 06:44:13 +00:00
Ulf Hermann 6557b71188 Make QQmlDebugService::registerService() private and part of ctor
By forcing all debug services to register before the thread starts we
can get rid of the complicated thread synchronization and have a more
natural API for the services.

We can also better enforce the thread situation when registering
services in QQmlDebugServer now. QQmlProfilerService should not
moveToThread() in its constructor as the thread has not been started,
yet. The thread affinity of QQmlProfilerService doesn't make any
difference anyway, as all relevant methods are protected by mutexes
and it doesn't have any slots.

Change-Id: I57db9e2bf94ec6884ede694715dadf5bfd687334
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-30 14:55:19 +00:00
Ulf Hermann 7d8e29534d Extract minimal interface from QQmlDebugServer and use it.
This will allow us to move QQmlDebugServer into a plugin. The new QQmlDebugServer
is the interface exposed to connection plugins. The interface exposed to services
is renamed to QQmlDebugConnector, as technically it doesn't have to be a
"server".

Change-Id: Id508b8c0a6960228e889f45a437b73060392db39
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-30 09:08:49 +00:00
Ulf Hermann 7784327e71 Use QVector rather than QList for storing QQmlProfilerData
Change-Id: I94519181e915c5e2df9614ad4e1180fb159252e3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-29 14:36:20 +00:00
Ulf Hermann 7fc0d03b51 Remove QQmlDebugService::objectToString()
It isn't used anywhere.

Change-Id: I73e2f448be30c04dca4d7122d173782e302478bd
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-29 14:36:06 +00:00
Ulf Hermann c866ba8e3a Remove some methods from QQmlDebugServer
They were only used internally or for redundant checks in the tests.

Change-Id: Iaa7d52be030adaa52a07b28fba53bdef9fada879
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-29 14:35:56 +00:00
Ulf Hermann db90054b18 Remove static proxy methods from QQmlDebugService
They all internally map to one-liners and just add to binary size and
complexity. Especially, the most used one, isDebuggingEnabled(), simply
checks if there is a QQmlDebugServer::instance().

Change-Id: Ib269928e08506894d933f6696e34ff0d3acb048b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-29 14:35:54 +00:00
Friedemann Kleint 0ea3c24cfe tests/qml: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

Change-Id: I8cc97fd9b48fc789a849e9527c292c4e05accd97
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-29 09:44:39 +00:00
Friedemann Kleint 0959281be2 Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).
Preparing the replacement of Q[TRY]_VERIFY(a == b) by
Q[TRY]_COMPARE(a, b) for non-boolean types.

Change-Id: I8a4e44a2b4e20a9c8b811799e3932c8ce1a2cbbb
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-27 12:32:49 +00:00
Ulf Hermann 5ba31c335d Make tst_QQmlInspector::reloadQmlWindow() fail more quickly
It's annoying that we have to wait for 5s, just for the confirmation
that QTBUG-33376 isn't fixed.

Change-Id: I6296cc05d6dc7240ec3182ff10b19e40d5d4e599
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-22 16:54:06 +00:00
Eskil Abrahamsen Blomfeldt 40b9fb8946 Fix possible stack overflow with many property bindings
When there are a lot of bindings to the same property (like 20 000),
we would get stack overflows because the notify list for the
changed signal was traversed recursively.

Changing this also speeds up the traversal. I see something like
~40% reduction in the case of layout() for a notify list of around
200 items.

Note: To make it possible to traverse the double-linked list backwards,
the next-pointer needs to be moved to the beginning of the struct,
because the implementation pattern assumes this
(node->next->prev = &node->next).

I think this code has rotted after it was added, since the prev pointer
was never actually used anywhere before.

Change-Id: Icdfac50b7c8584a908efa65694c7f5f416cb153b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-07-21 12:04:27 +00:00
Shawn Rutledge 96c35a84d3 fix readonly metaproperties (revealed by compiler warning)
Found thanks to -Wparentheses + gcc 5.1

Change-Id: Iad784a26d268b85f7c67623fd63f0b097a9f29f9
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-21 09:00:57 +00:00