The infinite recursion occurs because we call QFileInfo::exists()
even if no change/fix is done, if a file in a resource if actually
missing.
If fileName != fixedPath the ":" prefix has been replaced by an
absolute path and a new call to ::create will early reject.
Typically the directories do not match, so nothing is replaced.
This crashed without the fix.
With the fix we will always remove the ":" prefix
and therefore we do not try to handle the "fixed" case.
Even, a broken path that contains multiple ":" we would
only handle a finite number of times until all ":" are fixed.
Change-Id: Ie13cedc1212bb58a16c61e0137128539d189269d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
QML does not accept absolute paths (e.g. C:\working\something\) as urls.
We need the file:/// prefix.
Change-Id: I9df74cd9c0e730fba056af971751f8eb88cdb536
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Problem was that a file added to resource it
wasn't shown in the canvas.
Change-Id: I57610db8a55791c409bd249d698bf757cde153b9
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
The code model knows about .qrc files and has a mapping
that we forward to the qml2puppet.
Support for .qrc was broken when introducing the QmlPrivateGate.
Change-Id: I22d1c1add65d0c9a914e471dbe51ef505f308494
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This reverts commit 74e863f867 as it
breaks compile with Qt5.4.
Change-Id: Ifce52a7790c4f40ce0ccd56a2daacc4d32fe3257
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
In Qt 5.6 we do not need to access the private API directly.
QmlPrivateGate is forwarded to the helper functions in Qt.
This removes direct dependencies to QML internals in qml2puppet.
Change-Id: I274cb306815824c988b6d79966f007298f6d1e60
(cherry picked from commit d6d0bd60357a41cd6c83b511fd30ab12157ed95d)
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
MetaInfo cannot depend on ObjectNodeInstance.
I forward the QObject and the QmlEngine all the way through.
The commented code in metainfo.cpp is about defining a context
for the root item. The feature is basically unused, but we can bring
it back using a callback later.
Change-Id: I8f099b06c848e2faeaafc011ac6bd313192a64bd
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
MetaObject cannot have a dependency on ObjectNodeInstance.
Instead we register a callback.
Change-Id: I9f6e096c67caf1abd525201c9bacd363d31a2fa2
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
A simplified version of NodeInstanceSignalSpy is required to track
sub objects. I moved all private API usage to QmlPrivateGate.
Change-Id: I86e3e5411eb43777a6b1ab5018a1b8fb9088c666
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
No need to use private API in QuickItemNodeInstance.
Change-Id: I5450ea41571c2787081cc88f59494a28eea5546c
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
We cannot keep the context.
The context has to be forwarded each time.
Change-Id: I50b944bea1c6ad30832490edad8b35f392c32029
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This class holds the additional data we use to annotate QObject.
At the moment we store the default values and bindings there.
I also moved the code to populate and read the hashes
into that class.
Change-Id: Ib5e4b5291cfd2bf5555a896bf42578d07f2c6253
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>