[Qt-qml] XML patterns and Namespace prefix

2010-11-21 Thread adrian hornsby
Hi all,

I am trying to parse an activity-stream:


tag:photopanic.example.com,2008:photo01
My Cat
2008-11-02T15:29:00Z


tag:atomactivity.example.com,2008:photo




 with QML XMLlistmodel and XMLrole as follows:

query: "/wall/entry"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "published"; query: "published/string()" }
XmlRole { name: "link"; query: "link/@href/string()" }


but get this error:
Error FODC0002 in
tag:trolltech.com,2007:QtXmlPatterns:QIODeviceVariable:src, at line 9,
column 25: Namespace prefix 'activity' not declared


any idea how to solve that. All work well if I use very simple XML docs.

thanks,

Adrian
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] JavaScript with .pragma library cannot see Component object

2010-11-21 Thread aaron.kennedy
Hi,

On 20/11/2010, at 2:41 AM, ext ext-ivailo.il...@nokia.com wrote:

> Yes I've read that, but the strange thing is that Component is just global 
> object for the JS - just like Qt. Why I can access Qt and cannot Components?

The name "Component" is bound by the presence of an import statement, whereas 
the "Qt" global object is always available.  Currently ".pragma library" JS 
files don't have access to any import statements (and consequently the name 
bindings that go along with them).  We'll fix this in the future.

For now you'll have to use hardcoded integers :(

Cheers,

Aaron


> In general the concept is great - I just would like to know what I can and 
> what I cannot do and access from within it. I think that sharing a static 
> constant inside a library will not break the library concept, right? - this 
> is just integer 1
> 
> Best Regards,
> Ivo
> 
> From: Hansen Rene.1 (EXT-ProDataConsult/Berlin)
> Sent: Friday, November 19, 2010 5:40 PM
> To: Iliev Ivailo (EXT-ProData/Berlin)
> Cc: qt-qml@trolltech.com
> Subject: Re: [Qt-qml] JavaScript with .pragma library cannot see Component 
> object
> 
> This is because when you include .pragma, you are really indicating that
> you want to create a stateless library. Here's an excerpt from the Docs
> about integrating Javascript:
> 
 
> Stateless JavaScript libraries
> Some JavaScript files act more like libraries - they provide a set of
> stateless helper functions that take input and compute output, but never
> manipulate QML component instances directly.
> 
> As it would be wasteful for each QML component instance to have a unique
> copy of these libraries, the JavaScript programmer can indicate a
> particular file is a stateless library through the use of a pragma, as
> shown in the following example.
> 
> // factorial.js
> .pragma library
> 
> function factorial(a) {
> a = parseInt(a);
> if (a <= 0)
> return 1;
> else
> return a * factorial(a - 1);
> }
> 
> The pragma declaration must appear before any JavaScript code excluding
> comments.
> 
> As they are shared, stateless library files cannot access QML component
> instance objects or properties directly, although QML values can be
> passed as function parameters.
> <<<
> 
> Hope this helps.
> 
> /René
> 
> On Fri, 2010-11-19 at 16:17 +, ext ext-ivailo.il...@nokia.com wrote:
>> Hi,
>> 
>> I'm trying to create JS library with QML. As written in the documentation I 
>> write in the beginning of the JS file .pragra library
>> everything is ok - now my library is not stuck to one QML file and I can 
>> everything is ok
>> 
>> the problem is that I cannot see Component.Ready and Component - it's not 
>> null, but I have error directly when I want to access it :
>> ReferenceError: Can't find variable: Component.
>> 
>> if I remove the .pragma library then everything is ok - I can see Component 
>> and Comonent.Ready
>> 
>> My question is:
>> 
>> Is it done on purpose? Is there any reason why I cannot use / and see / 
>> those objects in the library is "object". Just a quick tip - Qt object is 
>> there - I can see it with or without marking my JS as library.
>> 
>> For now I can just "wrap" the error - as Component.Ready is 1 - I will just 
>> replace it with 1, but it will be nice if I know what else I can and cannot 
>> do with libraries and not.
>> 
>> Best Regards,
>> Ivo
>> ___
>> Qt-qml mailing list
>> Qt-qml@trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-qml
> 
> 
> 
> ___
> Qt-qml mailing list
> Qt-qml@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml


___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Aliasing handler properties

2010-11-21 Thread aaron.kennedy
Hi,

On 19/11/2010, at 10:42 PM, ext 
simon.tur...@nokia.com wrote:

Why does this not work?

property alias onClicked: myEmbeddedMouseArea.onClicked

It’s just a property after all. Just one that’s just a function assigned to it.

When written like that it sounds trivial :)  In reality they're not "just" 
properties and they're not "just" assigned a function.  Of course, it is not an 
unreasonable thing to want to do, so if you create a bug we can look into it 
for a future release.

Cheers,

Aaron
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Component loading in background thread?

2010-11-21 Thread warwick.allison
> I'm exposing a complex QGraphicsWidget to QML and the problem is, that
> whenever I load that component my application freezes for a second (on
> desktop, on mobile it's much longer).
> 
> I'd like to display a lightweight 'loading' animation and load that
> component in the background without freezing the interface. Then
> whenever it's ready it should replace the animation with the real
> content.

There is no all-encompassing answer to this. Threading is not directly provided 
in QML object instantiation (it would make simple constructions way to slow).

Firstly, do you REALLY need to do all the construction you are doing? One 
second on the desktop is an inordinately huge amount of time. Perhaps a 
different approach is needed. For example, if you loaded an entire company 
addressbook at start-up, that might be better done per-record as needed.

Can you thread the internals of your class? For example, if you did need to 
load a huge addressbook, you could do that in a thread and have a "progress" 
property and "onLoaded" signal emitted as it progresses. This keeps the 
threading in the C++ side (QThread is your friend), while using QML's inherent 
asynchronicity on the QML side. The Image elements effectively work this way 
(though the actual threading is in QDeclarativePixmap).

--
Warwick

___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


[Qt-qml] Looking for existing Qt/QML MediaCenter application

2010-11-21 Thread Benjamin Zores
Hi,

I was wondering if anyone's currently working (or planning to) on a
QML-based MediaCenter application.

I'm project leader of GeeXboX [1] multimedia distribution and Enna [2]
EFL-based MediaCenter application and,
for various reasons, I'm considering a switch from EFL to Qt/QML since
quite a while.

Most of our codebase actually relies in 2 external libraries
(libplayer [3] and libvalhalla [4])
that we use for mediaplayer, metadata retrieval, database ... so the
UI parts that actually make use of EFL
are minimized to their minimum. As a result, I believe that migration
should be affordable without complete rework of existing code.

Though, instead of re-inventing wheel over and over again, I'd better
re-use existing code or extend existing projects if some already
exist.
So if someone's already working on a Qt/QML MediaCenter, please say so.
If no is and would be willing to contribute to one, please tell also,
I'd be more than happy to recruit new developers.

Ben

References:
- [1]: http://www.geexbox.org/
- [2]: http://enna.geexbox.org/
- [3]: http://libplayer.geexbox.org/
- [4]: http://libvalhalla.geexbox.org/
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Mouse wheel events in QML

2010-11-21 Thread Gregory Schlomoff
You have to make your own  component in C++ to catch them.


On Sun, Nov 21, 2010 at 1:29 AM, Girish Ramakrishnan
 wrote:
> See http://bugreports.qt.nokia.com/browse/QTBUG-7369. In short,
> Flickable supports it but not MouseArea.
>
> Girish
>
> On Sat, Nov 20, 2010 at 9:17 PM, Jerzy Chalupski
>  wrote:
>> I can't find any mouse wheel events handler. Am I selectively blind or
>> are mouse wheel events not supported by QML?
>> ___
>> Qt-qml mailing list
>> Qt-qml@trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-qml
>>
> ___
> Qt-qml mailing list
> Qt-qml@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Qt-qml Digest, Vol 9, Issue 53

2010-11-21 Thread ahmad.mushtaq


"ext qt-qml-requ...@trolltech.com"  wrote:


Send Qt-qml mailing list submissions to
qt-qml@trolltech.com

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.trolltech.com/mailman/listinfo/qt-qml
or, via email, send a message with subject or body 'help' to
qt-qml-requ...@trolltech.com

You can reach the person managing the list at
qt-qml-ow...@trolltech.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qt-qml digest..."


Today's Topics:

   1. Re: Using enums in QML signal handlers (jerome.pas...@nokia.com)
   2. Win/Lin differences (Jason H)
   3. Re: JavaScript with .pragma library cannot seeComponent
  object (Ville M. Vainio)


--

Message: 1
Date: Fri, 19 Nov 2010 23:33:48 +0100
From: 
Subject: Re: [Qt-qml] Using enums in QML signal handlers
To: , 
Cc: qt-qml@trolltech.com
Message-ID:

<7e2e76540f3c0c49bdeb06f892c61f0054f44e4...@nok-eumsg-04.mgdnok.nokia.com>

Content-Type: text/plain; charset="Windows-1252"

Hello,

There is a similar bug that was already fixed: 
http://bugreports.qt.nokia.com/browse/QTBUG-11313

How do you register the enum in the Qt Declarative module?
Did you use qmlRegisterUncreatableType?
http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeengine.html#qmlRegisterUncreatableType

Thanks,
Jerome P.

From: qt-qml-boun...@trolltech.com [qt-qml-boun...@trolltech.com] On Behalf Of 
Brasser Michael (Nokia-MS-Qt/Brisbane)
Sent: Wednesday, November 03, 2010 6:26 AM
To: Olli Salonen (EXT-Futurice/Berlin)
Cc: qt-qml@trolltech.com
Subject: Re: [Qt-qml] Using enums in QML signal handlers

Hi Olli,

This sounds like a bug -- could you please create a report at 
bugreports.qt.nokia.com?

Thanks,
Michael

On 02/11/2010, at 11:06 PM, ext 
ext-salonen.o...@nokia.com wrote:

Hi,

I have declared an enum in a class and use it as an argument in a signal. I can 
use the enum in QML, but I cannot read the parameter in the signal handler. Is 
it supposed to work somehow?

Example:

class MyObject {
  Q_OBJECT
  Q_ENUMS(MyEnum)
  Q_PROPERTY(MyEnum value READ value NOTIFY valueChanged)
public:
  enum MyEnum { Value1, Value2};
signals:
  void valueChanged(MyEnum value);
}

Qml file
--
MyObject {
  onValueChanged: console.debug(?Value is ? + value)
}

This fails with the following output:
QMetaProperty::read: Unable to handle unregistered datatype 'MyEnum' for 
property 'QDeclarativeBoundSignalParameters::value'

I also tried to rename the signal parameter type to MyObject::MyEnum, but this 
did not work either. I can use the value correctly if I access it as a 
property, or if I assign enum values such as ?property int myvalue: 
MyObject.Value1?.

Thanks,
Olli





--

Message: 2
Date: Fri, 19 Nov 2010 18:46:21 -0800 (PST)
From: Jason H 
Subject: [Qt-qml] Win/Lin differences
To: qt-qml@trolltech.com
Message-ID: <323032.9180...@web120711.mail.ne1.yahoo.com>
Content-Type: text/plain; charset=us-ascii

I am developing/testing on WinXP, deploying on Lin (TCE/X11/Nvidia ION) 4.7.0 on
both. I had some surprises...

1. When I set opacity to 255 (errantly) in Win, it renders fine. On Lin, it
doesn't render at all until opacity = 1
2. Text font.pointSize doesn't seem to be respected on Linux, but pixelSize is
works.





--

Message: 3
Date: Sat, 20 Nov 2010 09:47:38 +0200
From: "Ville M. Vainio" 
Subject: Re: [Qt-qml] JavaScript with .pragma library cannot see
Component   object
To: ext-rene.1.han...@nokia.com,"ext ext-ivailo.il...@nokia.com"

Cc: qt-qml@trolltech.com
Message-ID: <1290239258.1585.13.ca...@nokia-n900>
Content-Type: text/plain; charset="utf-8"

I think that documentation is misleading - you can easily maintain state in a 
singleton inside your .js file, using .pragma library.. You just need to ensure 
that you pass the needed qml side information in arguments instead of referring 
to them directly.

It's sort of like combining c++ and qml, really.

--
Sent from my Nokia N900

- Original message -
> This is because when you include .pragma, you are really indicating that
> you want to create a stateless library. Here's an excerpt from the Docs
> about integrating Javascript:
>
> > > >
> Stateless JavaScript libraries
> Some JavaScript files act more like libraries - they provide a set of
> stateless helper functions that take input and compute output, but never
> manipulate QML component instances directly.
>
> As it would be wasteful for each QML component instance to have a unique
> copy of these libraries, the JavaScript programmer can indicate a
> particular file is a stateless library through the use of a pragma, as
> shown in the following example.
>
> // factorial.js
>?  .pragma library
>
>?  function factorial(