[Qt-qml] "QML supports network transparency by using URLs"

Jason H scorp1us at yahoo.com
Mon Jul 12 03:41:55 CEST 2010


I spent this weekend "getting comfortable" with it (as if you couldn't tell by 
all my emails). I'm still iffy. Really, they need a "QML for Qt developers in 10 
minutes" guide. I know there is something already titled that, but I had to hunt 
around, and eventually I found the documentation that I needed to understand 
what is going on. The documentation that I found most important was not what was 
linked to. What I needed was the JS/Object bridging, and Qt/Object bridging. 
Once I got that, things seemed to make more sense. I might be a corner case, but 
I expect there will be more people like me who haven;t used QtScript. 


The other key thing that I needed to know was how it evaluated everything as a 
whole at first. The rest is just a lack of documentation. Like what is a 
component vs item vs package vs different qml file? (Eventually I figured out an 
item is just a container. ) Anyway it seems I have an older version of the docs 
and they are incomplete in places so this might just be a pre-release thing.

I am enjoying it very much though.

Anyway, to the matter at hand...

I know Qt well. I do not know QtScript or QML well.

With that said, could you provide example code? Say for a text item that can use 
a URL?
I think with all the 'short comings' in this initial version of QML, we'll be 
doing a lot of that...

Can we do it as a plugin as well? Where are the docs for this?





----- Original Message ----
From: Gregory Schlomoff <gregory.schlomoff at gmail.com>
To: Jason H <scorp1us at yahoo.com>
Cc: qt-qml at trolltech.com
Sent: Sun, July 11, 2010 9:01:21 PM
Subject: Re: [Qt-qml] "QML supports network transparency by using URLs"

Hello everybody,

Just a small comment: last week, we built our first QML component in
C++, and it was way more easier than we would have thought.

All of a sudden, we discovered that extending QML from C++ either by
subclassing existing items or by creating new ones from scratch was
*really* easy, and that for all the things that we are missing in the
official QML API, we could built it ourselves (like changing the mouse
cursor shape, or adding support for drag and drop functionnality - two
points that I previously asked this mailing-list about).

I'm telling this story because I realiized that although the docs are
great from a technical point of view (everything is clear and easy to
understand), maybe the examples could have better choosen to
illustrate more real-life cases. I'm thinking of the Person and the
Musician examples here. They are easy to understand, but when you see
them, you don't think: "I could use this to create a subclass of the
Text component that would allow me to specify text by an URL."

That's my 2 cents to the doc team. And Jason, if you're at least
somewhat comfortable with C++, you may want to try implement your
suggestio, it's really easier than it sounds.

Kind regards,

Greg

On Sun, Jul 11, 2010 at 11:55 AM, Jason H <scorp1us at yahoo.com> wrote:
> Text {
>  source: "http://iscaliforniaonfire.com"
> }
>
> Does not work.
> Before you tell me to use a model, let me point this out. I was trying to make 
>a
> crawler/ticker, like on the news stations.
> When I tried to use a model, they were uniformly spaced, and that's not
> acceptable.
>
>
> It would be cool if I could specify source for any string, that could ever be
> used (performance implications are left to the coder) as well as specify a 
>XPath
> query It might be cool also specify an XPath query too, sot that
>
> Text {
>  source: "http://iscaliforniaonfire.com"
>  sourceQuery: "/body/H1/text()"
> }
>
> It may be good to make a Document element type:
> Document {
>     id: californiaFireStatus
>     source: "http://iscaliforniaonfire.com"
>     query{
>         id:yesno; query: "/body/H1/text()"
>     }
>     query{
>         id:title; query: "/head/title"
>     }
>
> }
>
> Text {
>        source: californiaFireStatus.yesno
>
> }
>
> Or something like that. I think my only option now is to fetch it into a model
> and then glue it together?
>
>
>
>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>



      




More information about the Qt-qml mailing list