Commit Graph

42 Commits

Author SHA1 Message Date
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.

Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).

Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-26 07:13:18 +00:00
Liang Qi a9a9fa0c47 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
	src/qml/compiler/qqmlirbuilder.cpp
	src/qml/compiler/qqmlirbuilder_p.h
	src/qml/compiler/qqmltypecompiler.cpp
	src/qml/compiler/qv4codegen.cpp
	src/qml/compiler/qv4codegen_p.h
	src/qml/compiler/qv4compileddata_p.h
	src/qml/compiler/qv4compiler.cpp
	src/qml/compiler/qv4compilercontext_p.h
	src/qml/compiler/qv4isel_moth.cpp
	src/qml/compiler/qv4jsir.cpp
	src/qml/compiler/qv4jsir_p.h
	src/qml/jit/qv4isel_masm.cpp
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4functionobject.cpp
        src/qml/jsruntime/qv4runtimecodegen.cpp
	src/qml/jsruntime/qv4script.cpp
	src/qml/jsruntime/qv4script_p.h
	src/qml/qml/qqmltypeloader.cpp
	src/quick/items/qquickanimatedimage.cpp
	src/quick/items/qquickanimatedimage_p_p.h
	src/quick/scenegraph/compressedtexture/qsgpkmhandler.cpp
	tests/auto/qml/qmlplugindump/qmlplugindump.pro
	tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
	tools/qmlcachegen/qmlcachegen.cpp
	tools/qmljs/qmljs.cpp

Done-with: Shawn Rutledge <shawn.rutledge@qt.io>
Done-with: Lars Knoll <lars.knoll@qt.io>
Done-with: Ulf Hermann <ulf.hermann@qt.io>
Change-Id: I010e6525440a85f3b9a10bb9083f8e4352751b1d
2018-02-02 15:59:32 +01:00
Ulf Hermann c66c0ba4dd Match QQmlEngineDebugServiceTest to the service
The fact that the service transmits QObject properties by their
objectNames, rather than as proper references is not very useful and in
fact the reason for some strange behavior in QtCreator. However, it's
been that way for a long time and we should test what the service
actually does.

Task-number: QTBUG-65852
Change-Id: I6e489bb9877fae129432b5b3d5d4c7bfb5deaa9b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-01-25 12:47:12 +00:00
Ulf Hermann bc36eb420e QQmlEngineDebugService: Output better diagnostics on test failure
Apparently this check fails sometimes. We want to know what kind of
value causes it to fail.

Task-number: QTBUG-65852
Change-Id: I732ee5e3b224567bf3ea34d57bef5d78bfdd6ca1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-25 12:47:08 +00:00
Ulf Hermann 66f8b97f5e QQmlEngineDebugService: Actually call value types' toString() method
QML value types generally are Q_GADGETs, but the userType we see there
is the wrapped class's type, which doesn't have to be a gadget. So, the
toString() method was rarely called, and a model index would still crash
the debug service.

Change-Id: I63778953eb9d2fc60113c11057da3047fc75a9bd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-01-08 12:06:40 +00:00
Ulf Hermann 8799923814 QQmlEngineDebugService: Check QML contexts for validity
We should not operate on invalid QML contexts and once we have
established a context to be valid we don't have to check the result of
QQmlContextData::get anymore.

Change-Id: I9106115ddf925c3572048f1fd334bdfd9a9cfca7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-05 12:24:20 +00:00
Ulf Hermann 9b4d31825e Qml Debugger: Make sure all objects have a type
QQmlMetaType::prettyTypeName() does a better job in finding a valid type
name for our objects than we can do ourselves.

Task-number: QTCREATORBUG-17741
Change-Id: Ie8a192aceb230e73b5295b745987692548aff641
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-31 08:30:56 +00:00
Ulf Hermann 6746db54f2 QML tooling: Make sure we signal object creation also from QQmlIncubator
We have to call the QQmlEngineDebugService back from QQmlObjectCreator
rather than QQmlComponent, as there are more ways to create an object.

We also add the new instance to the global instance list if only the V4
debug service is active, as both QQmlEngineDebugService and
QV4DebugService use it.

Change-Id: I5dcc71b2e91049bc19ec70d7b87959a61c9b6b75
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-11 11:51:08 +00:00
Erik Verbruggen fa50403ab3 QML debugger: Fix test
Use delete[] on a new[]-ed pointer.

Change-Id: Ic5721851bdcec284cdd631b81d2cc96b7a1748fc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-03 09:08:41 +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
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 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
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 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 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
Lars Knoll 7be7651e9d Get rid of QQmlBoundSignalExpression::ExtraData
The extra data was only used to delay initialization of the
required FunctionObject to the first time evaluate got called.
In addition, the constructor using ExtraData was only ever called
from the debugger. In that case performance can't be critical, so
we can just as well do function object creation at construction time.

This saves one pointer in the object.

Change-Id: I46ce9aa325f0fa95b5b0e374e9c07d673e454dd4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-18 05:48:05 +00:00
Ulf Hermann 2ca2d97784 Initialize members of tst_QQmlEngineDebugService
Change-Id: Id9fe7d2bd630bcfe79634b3a4465ec7ad764d18c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-15 09:31:17 +00:00
Jani Heikkinen c5796292ad Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Kai Koehne efa81f8354 Inspector: Do not assert when trying to stream QModelIndex
Some QVariant's like QModelIndex cannot be streamed in a meaningful way:
QDataType::save() will return false for them. However, this leads to a
qWarning and Q_ASSERT in QVariant::operator<<().

To prevent this we're calling QDataType::save() manually beforehand. We
however throw away the result if it succeeds, and still call
QVariant::operator<<() to get the benefits of the QDataStream version
handling.

The alternatives would be to make QVariant::operator<<() not assert,
or blacklist all known types with problems manually. Both seem to
be difficult though ...

Change-Id: I4f5fe6d5a3a076c24fbc73371a4d12d720de53da
Task-number: QTBUG-42438
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-07 09:15:01 +01:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-25 11:28:46 +02:00
Michael Brasser b9fbb7d9c8 Remove redundant QQmlBinding members.
This reduces the size of QQmlBinding by 12 bytes.

Task-number: QTBUG-37134
Change-Id: Id55257edec8cee88d863374e8a96d7eebbeaf523
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-03-11 19:59:05 +01:00
Simon Hausmann c39393e7de Compile binding expressions in the QQmlCompiler
This is done by re-using the JS code generator from the new compiler. A few bugs were
fixed on the way:

 * The index into the compiledData->runtimeFunctions array is not the same as the function
   index when they are collected (from the AST), as for example binding expressions may create
   extra V4IR::Function objects that break the 1:1 mapping. Therefore the JS code gen will return
   a mapping from incoming function index to V4IR::Module::Function (and thus runtimeFunction)
 * Binding expressions in the old backend get usually unpacked from their ExpressionStatement node.
   The reference to that node is lost, and instead of trying to preserve it, we simply synthesize it
   again. This won't be necessary anymore with the new compiler in the future.
 * Commit 1c29d63d60 ensured to always look up locals by name, and so
   we have to do the same when initializing the closures of nested functions inside binding expressions
   (in qv4codegen.cpp)
 * Had to change the Qml debugger service auto-test, which does toString() on a function that is now compiled.
   Even if we implemented FunctionPrototype::toString() to do what v8 does by extracting the string from the
   file, it wouldn't help in this test, because it feeds the input from a string instead of a file.
 * In tst_parserstress we now end up compiling all JS code, which previously was only parsed. This triggers
   some bugs in the SSA handling. Those tests are skipped and tracked in QTBUG-34047

Change-Id: I44df51085510da0fd3d99eb5f1c7d4d17bcffdcf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-10-11 22:54:52 +02:00
Simon Hausmann 06eaeb0ac8 Get rid of the signal expression rewriter
This replaces the entire rewriter with more or less:

expressionToEval = "(function(<named params here>) { " + expr + " } )"

This also fixes crashes at run-time when the signal rewriter was
executed from the loader thread and tried to use a v4 identifier
hash with the same engine that's also in the main thread.

Change-Id: Ib1e4927d330706a593411fbff64ed3da1e23d0e0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-07-03 13:22:25 +02:00
Sergio Ahumada 83deab8d1b Update copyright year in Digia's license headers
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-10 19:52:37 +01:00
Iikka Eklund 46010aa7a2 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-23 08:22:24 +02:00
Chris Adams 03192f749c Don't provide typehint in QQmlExpression::evaluate()
Previously, the result returned by QQmlExpression::evaluate() was
converted from the actual JavaScript result with a default typehint
of QList<QObject*>.  This commit removes that typehint so that the
engine's conversion code will choose the most appropriate return type
for the result JavaScript value, instead.

Task-number: QTBUG-17082
Change-Id: I368a018b235e9e001b1b92db3699de377748b74f
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-07-11 02:59:49 +02:00
Aurindam Jana 9ce3a474e6 QQmlEngineDebugService: Property Data of type QVariant
Send property data of type QVariant to the client.

Change-Id: I5a18da18f1347935e4ccaafb05e3a877e73bbede
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
2012-05-25 13:35:16 +02:00
Simjees Abraham b909ce4f50 Debugger: Removing the deleted objects from objectReferenceHash
The invalid entries from objectReferenceHash in QQmlDebugService
is removed once the Qml object is destroyed.

Task-number: QTCREATORBUG_7451

Change-Id: I8d2ccafe81a811ea319f13fd99fbde3c13e6b2be
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-05-24 12:52:43 +02:00
Simjees Abraham fe652f6cfb Qml : Resetting binding corrected
Resetting the binding for property corrected in case the property is
nested (eg: font.bold)

Task-number: QTCREATORBUG-6294
Change-Id: I39cca54c17860c4e6df1cf864cc2f70214d50c8f
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
2012-05-21 12:40:55 +02:00
Aurindam Jana 6f9b3893c8 QQmlDebugService: Fetch Objects for location info
Fetch Objects for given filename, line number and column
number.

Change-Id: I9a81e4c7fa75faaf87f02453026c5320b7f86003
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-05-12 11:00:34 +02:00
Aurindam Jana c6c3673143 QQmlEngineDebugService: Query Expression
If the scope object is null or if there no QML context for
the scope object, try to use the root context of the engine.

Change-Id: I0068ea36f18a179b44791b81a2f6b8ec5423f615
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-05-09 12:23:11 +02:00
Simjees Abraham 1e8dc1636c irrelevant qDebug removed
Irrelevant debug statement which gets printed at start of debug session
is removed. The same is removed in Auto-tests as well.

Change-Id: If8f44950952f08b55ff884c1fe42670108e2369d
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-30 14:37:14 +02:00
Chris Adams 53d5deb503 Use minimal javascript expression for bound signals
Previously, QQmlBoundSignal used QQmlExpression internally.  This
commit adds a new, more optimal QQmlJavaScriptExpression subclass
specifically designed for QQmlBoundSignal, and converts the code
to use it instead of QQmlExpression where appropriate.

Task-number: QTBUG-24460
Change-Id: I2865a119ce840235e27a7722d8052ca61c265f69
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-29 00:40:48 +02:00
Michael Brasser 68ac4c57c4 Remove QObject parenting from QQmlAbstractBoundSignal.
Change-Id: If549cf57bbac18a986a2a0e63fdc76902d2dae43
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-26 07:24:29 +02:00
Michael Brasser fa3ef5376a Use QQmlAbstractBoundSignal where appropriate.
Prepare for the addition of another subclass.

Change-Id: I340f735503e661d9d735f3316a065f807294921b
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-26 07:24:29 +02:00
Aurindam Jana 3a3515b5a7 QmlEngineDebug: Simplify the utility classes
Change-Id: Ie0e1b6e9edd6a09fef565635cc793f8bdb6c42e7
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 17:07:27 +01:00
Aurindam Jana 7f963aa41d QmlEngineDebug: Rename to QmlEngineDebugClient in AutoTest
Change-Id: If20b53d2e47cdc4ed54df0d9360ae1b0566489c6
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 17:07:15 +01:00
Aurindam Jana cad5df2572 QmlDebugging: Object Tree and States List
All created instances are stored under the root context.
Check for the creation context of the object when building
up the tree. Do the same when building up the states list.

Change-Id: I8716d9966a61b8f7cb3ad4b7ab5acd4c94b4cd03
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 10:49:45 +01:00
Kai Koehne e1d688a237 Debugger: Print informational messages via qDebug
This allows users to use QT_FATAL_WARNINGS.

Change-Id: I114825764c841030418c956d23575159157dfd69
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-14 15:32:55 +01:00
Aurindam Jana 5c7b17379d QmlDebugging: Remove QQmlDebugClient
Remove QQmlDebugClient and relevant classes from the
library and move to client code.

Change-Id: I6f526b3f0c92970dcad5e5abd8585bb9b406349e
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-09 09:48:24 +01:00