[Development] qt quick with dummydata/context in Ubuntu 15.10

Fabian Sturm f at rtfs.org
Wed Jan 27 17:01:26 CET 2016


I try to edit a qml file in QtCreator and it obviously has problems  
since I refer to a non existent parent.width property.
The solution as described here:  
http://blog.qt.io/blog/2011/07/28/mockup-data-for-the-qml-designer/ is  
to create a dummydata/context directory and in this create a file with  
the same name as the original qml file which provides the context.

Unfortunately this seems to not work in Ubuntu 15.10. From the strace  
of the QtCreator (and childs) I see that it successfully loads the  
context document but then fails loading the QmlDesigner plugin. Maybe  
that is the reason for my problem?

Here are the files:


import QtQuick 2.3
Text {
     width: parent.width
     height: parent.height
     text: clock.time

dummydata/clock.qml (that is loaded correct)

QtObject { property int time: 54321 }


import QtQuick 2.3
import QmlDesigner 1.0

DummyContextObject {
     parent: Item {
         width: 640
         height: 300

What do I need to do to get ot working? Or is there another way to  
provide a default parent?

Thanks a lot,

More information about the Development mailing list