Re: [Qt-qml] Loading external QML files

2010-07-27 Thread Martin Jones
Another option is to have the loaded QML expose some signals that you can connect to. For example if you load: // MyItem.qml Item { id: myItem signal closeView MouseArea { onClicked: myItem.closeView() } } using: Loader { id: myLoader source: "MyItem.qml" } th

Re: [Qt-qml] Dynamically created items and properties

2010-07-27 Thread aaron.kennedy
Hi, On 27/07/10 7:19 PM, "ext Jan Ekholm" wrote: > On Tuesday 27 July 2010 01:42:36 Martin Jones wrote: >> The above is not a binding. It is an assignment. Bindings are created >> using the colon syntax. > > Ah, great! I hoped there was something that I just didn't grok. I've never > noticed

Re: [Qt-qml] Dynamically created items and properties

2010-07-27 Thread aaron.kennedy
On 27/07/10 11:00 PM, "ext Jason H" wrote: > I was told time time ago that y: parent.height/3 would be cintonually > evaluated. > At which point I realized I didn't know enough. I've searched the docs and I > don't think anything has been added yet. http://doc.trolltech.com/4.7-snapshot/prop

Re: [Qt-qml] Loading external QML files

2010-07-27 Thread aaron.kennedy
Hi, QML does not currently expose any “event” like concept. It might in the future. For now, you can call methods in the parent QML file directly if you want, although that does restrict the contexts within which the sub-file can reasonably be used. Cheers, Aaron On 28/07/10 2:13 AM, "ext

Re: [Qt-qml] What's wrong with our XmlListModel?

2010-07-27 Thread Daker Fernandes
Ivan, Looks Like you're trying to read a data inside namespace without saying you're using it. Note that all the elements in the Xml is inside a namespace: ... http://www.orange.co.uk/ns/app/1";> ... The xmlns says that all the iternal tagas are from http://www.orange.co.uk/ns/app/1. This a mech

Re: [Qt-qml] anchors.horizontalCenter bug ?

2010-07-27 Thread Eduardo Fleury
Yep, good thing it works now. Just a word of advice on my own way of debugging declarative interfaces that might be handy in the future. In situations like this one what I do is to create a semi-transparent rectangle and anchors.fill it to the "bad-behaving" item. In this case, I would do, inside

Re: [Qt-qml] Loading external QML files

2010-07-27 Thread Ben Marinic
Thank you Gregory. My newbie questions continue. Where in the docs should I look regarding custom events? Can I add a listener to the loader instance which is listening for a custom event triggered by the child QML file? In my example a mouse event from the child QML file needs to bubbl

[Qt-qml] What's wrong with our XmlListModel?

2010-07-27 Thread Ivan De Marino
Hi QML people We are facing a very weird behaviour of XmlListModel, and after long "try this and try that", seems like the problem is inside XmlListModel. BUT, before filing a bug, I ask you to take a quick look to the code, to see if we are doing anything wrong. Can you :D ? 1. Use of XmlListMo

Re: [Qt-qml] Dynamically created items and properties

2010-07-27 Thread Jason H
I am very much in your position. There's not enough documentation on the internal 'magic' of QML, which is my mental block as well. I was told time time ago that y: parent.height/3 would be cintonually evaluated. At which point I realized I didn't know enough. I've searched the docs and I don'

[Qt-qml] QML needs an Interface concept

2010-07-27 Thread Stephen Kelly
Hi, I solved the action tree problem I posted about before by implementing a recursive element container. http://lists.trolltech.com/pipermail/qt-qml/2010-July/000725.html You can see it here currently: http://websvn.kde.org/trunk/KDE/kdepim/mobile/lib/ Now I can do something like this: KPI

Re: [Qt-qml] anchors.horizontalCenter bug ?

2010-07-27 Thread Stephen Collyer
On 27 July 2010 00:23, wrote: > > anchors.horizontalCenter: parent.horizontalCenter > width: parent.width > > Which means to force the text to be as wide as the parent, then center that > in the parent (which does nothing since they're the same size). > > Yes, you're right. The parent.width i

Re: [Qt-qml] Loading external QML files

2010-07-27 Thread Gregory Schlomoff
You're looking for the Loader element :) Have a look at the doc: http://doc.trolltech.com/main-snapshot/qdeclarativeelements.html On Tue, Jul 27, 2010 at 5:53 PM, Ben Marinic wrote: > Hi > > I'm new to QML - having used Flex for many years. Is there a way for a QML > file to load another QML fi

[Qt-qml] Loading external QML files

2010-07-27 Thread Ben Marinic
Hi I'm new to QML - having used Flex for many years. Is there a way for a QML file to load another QML file on demand? Something like the way an image can be loaded - passing in the image location into the source property. I looked at the File class but can't quite figure out how to imple

Re: [Qt-qml] Dynamically created items and properties

2010-07-27 Thread Jan Ekholm
On Tuesday 27 July 2010 01:42:36 Martin Jones wrote: > The above is not a binding. It is an assignment. Bindings are created > using the colon syntax. Ah, great! I hoped there was something that I just didn't grok. I've never noticed the difference before. > One solution is to provide the Uni