Re: [Qt-qml] Accessing dynamic properties

2010-09-14 Thread aaron.kennedy
Hi, No it doesn't work, and no its not supposed to work. Qt's dynamic properties do not fit the QML model very well which relies on knowing the complete static type of an object prior to instantiation, and we'd prefer not to support them. Perhaps if you give more details about the actual problem

Re: [Qt-qml] Dummy model for QList model

2010-09-14 Thread michael.brasser
On 15/09/2010, at 12:32 AM, ext Cornelius Hald wrote: > On Tue, 2010-09-14 at 16:10 +0200, Stephen Kelly wrote: >> Cornelius Hald wrote: >> >>> Thanks! qmlRegisterType() helped with my own model (derived from >>> QAbstractListModel). With QObjectListModel I'm still having a problem, >>> because I

Re: [Qt-qml] Font rendering quality in QDeclarative

2010-09-14 Thread michael.brasser
On 15/09/2010, at 8:58 AM, ext Alex wrote: > Hi all, > > For a while now, I've had the nagging feeling that text doesn't look > quite right in my application. As a sanity check, I ran the > availableFonts.qml sample application (from declarative/text/fonts) > using QML Viewer, and it looked fine.

Re: [Qt-qml] Dummy model for QList model

2010-09-14 Thread michael.brasser
On 14/09/2010, at 9:10 PM, ext Cornelius Hald wrote: > Hi! > > On Tue, 2010-09-14 at 01:00 +0200, michael.bras...@nokia.com wrote: >> Is the above the exact wording of the error message you are seeing (if so, >> what release version are you using)? If the objects in the list are >> QtObjects, I

Re: [Qt-qml] Autotest for XmlListModel

2010-09-14 Thread michael.brasser
Okay, it looks like they aren't included in the source packages either. You'll need to pull the source from qt.gitorious.org to access the autotests then. Michael On 14/09/2010, at 3:21 PM, ext Anton Alferov wrote: I'm using qt-everywhere-opensource-src-4.7.0-rc1.tar.g

Re: [Qt-qml] QSortFilterProxyModel with QML ListView

2010-09-14 Thread Martin Jones
On Wed, 15 Sep 2010 06:13:02 am ext Cornelius Hald wrote: > Hi, > > On Tue, 2010-09-14 at 17:48 +0200, Stephen Kelly wrote: > > Cornelius Hald wrote: > > > Hi, > > > > > > I've now managed to use my own data model together with a customized > > > QSortFilterProxyModel to provide sorting and searc

Re: [Qt-qml] Global mouse coordinates

2010-09-14 Thread Martin Jones
On Wed, 15 Sep 2010 09:17:47 am ext Сурик Саядян wrote: > Can I get global mouse coordinates in MouseArea? mouseX and mouseY - > is local coordinates. QMouseEvent conteins globalX and globalY. But in > MouseArea they are absent. I want to move widget on the screen by > mouse. The best I can sugges

Re: [Qt-qml] emit data on a QAbstracListModel does not update the QML ListView.

2010-09-14 Thread Martin Jones
On Wed, 15 Sep 2010 05:26:58 am ext Bartosh Wroblevksy wrote: > Hi Steve, > > I forgot to ask about this: > > > 2) I have trouble seeing how in this case, moving rows and changing > > > data is not equivalent. In fact,unless my morning coffee was not > > > caffeinated. If I write > > > > > > m_el

Re: [Qt-qml] Python and QML

2010-09-14 Thread michael.brasser
On 15/09/2010, at 2:40 AM, ext Robert Garrett wrote: > Hi all, > I'm not sure if this is the correct place for my query, but if not > hopefully someone could point me to the right place. > > I'm building an embedded application using QML for the front-end and > python for the back-end. I'm not s

[Qt-qml] Global mouse coordinates

2010-09-14 Thread Сурик Саядян
Can I get global mouse coordinates in MouseArea? mouseX and mouseY - is local coordinates. QMouseEvent conteins globalX and globalY. But in MouseArea they are absent. I want to move widget on the screen by mouse. Thanks Surik ___ Qt-qml mailing list Qt-q

[Qt-qml] Font rendering quality in QDeclarative

2010-09-14 Thread Alex
Hi all, For a while now, I've had the nagging feeling that text doesn't look quite right in my application. As a sanity check, I ran the availableFonts.qml sample application (from declarative/text/fonts) using QML Viewer, and it looked fine. I then ran the same application using QDeclarative an

Re: [Qt-qml] Writing to property alias

2010-09-14 Thread Eduardo Fleury
On Tue, Sep 14, 2010 at 1:23 PM, Leonardo Cunha wrote: > my question is whether writing to an alias property should override or not > any binding existing on the aliased property Hi Leo, IMO short answer is it should not. The rationale is the classical Slider example.. == Slider.qml ==

Re: [Qt-qml] Python and QML

2010-09-14 Thread Jason H
I forgot to mention, you could always just bolt a python interpreter on to Qt/QML without the need for PySide/PyQt Pseudo code: Call PyInitialie() Call Py_ImportModule() Get PyObject pointers to your functions. Call the Python functions in your UI handler slots. The raw Python API is quite sim

Re: [Qt-qml] Python and QML

2010-09-14 Thread Jason H
What I would do is ditch (or adapt) your python stuff and use signals/slots in the declarative engine. You could have it control the motors directly. Or, if you have too much invested, use proxy objects to receive the signal, then have it send out a socket or whatever, in a means your python scr

Re: [Qt-qml] Python and QML

2010-09-14 Thread Robert Garrett
My application will allow a user to control some hardware (for example some motors). I have some code written in python that handles the comms and other aspects of hardware control, and there's a well defined interface for controlling them and reading back the status etc. I've also now got a QML

Re: [Qt-qml] QSortFilterProxyModel with QML ListView

2010-09-14 Thread Cornelius Hald
Hi, On Tue, 2010-09-14 at 17:48 +0200, Stephen Kelly wrote: > Cornelius Hald wrote: > > > Hi, > > > > I've now managed to use my own data model together with a customized > > QSortFilterProxyModel to provide sorting and searching for my QML UI. I > > still have two open questions, though. > > >

Re: [Qt-qml] emit data on a QAbstracListModel does not update the QML ListView.

2010-09-14 Thread Bartosh Wroblevksy
Hi Steve, I forgot to ask about this: > > 2) I have trouble seeing how in this case, moving rows and changing data> > > > is not equivalent. In fact,unless my morning coffee was not caffeinated.> > > > If I write> > > > m_elements[1] ="x"; emit dataChanged(index(1,0), > > index(1,0));> > Should

Re: [Qt-qml] Pause animation until a condition is met

2010-09-14 Thread Alex
On Mon, Sep 13, 2010 at 9:10 AM, Adriano Rezende wrote: > On Fri, Sep 10, 2010 at 3:32 PM, Alex wrote: > The first issue can be easily fixed adjusting onConditionChanged to > check if target is running and if the action has already being > consumed or not. But I wouldn't suggest this component a

Re: [Qt-qml] emit data on a QAbstracListModel does not update the QML ListView.

2010-09-14 Thread Bartosh Wroblevksy
Thanks Steve for answering my questions. This really helps. > From: steve...@gmail.com > To: qt-qml@trolltech.com > Date: Tue, 14 Sep 2010 20:32:37 +0200 > Subject: Re: [Qt-qml] emit data on a QAbstracListModel does not update the > QML ListView. > > Bartosh Wroblevksy wrote: > > > > > Hel

Re: [Qt-qml] emit data on a QAbstracListModel does not update the QML ListView.

2010-09-14 Thread Stephen Kelly
Bartosh Wroblevksy wrote: > > Hello Steve, > Thank you for filing the BR. I have a few questions. > > 1) What's the number of the bug? http://bugreports.qt.nokia.com/browse/QTBUG-13628 > > 2) I have trouble seeing how in this case, moving rows and changing data > is not equivalent. In fact,

Re: [Qt-qml] Python and QML

2010-09-14 Thread Jason H
I don't think there are any implementations of a python declarative engine. Even so, it would only be wrapped. PyQt won't do it until 4.7 is released, but it should appear in the snapshots days after. With the models and source, what does the back-end implementation matter? it should me XML/i

Re: [Qt-qml] Accessing dynamic properties

2010-09-14 Thread denis.dzyubenko
On 14. sep. 2010, at 18.20, Hicks Jamey (Nokia-NRC/Cambridge) wrote: > How did you pass in the object? If you pass it as a QVariant you need to cast > it to QObject * first to make its slots and properties available. I've created a test app that shows the problem. Maybe someone can tell me if

[Qt-qml] Python and QML

2010-09-14 Thread Robert Garrett
Hi all, I'm not sure if this is the correct place for my query, but if not hopefully someone could point me to the right place. I'm building an embedded application using QML for the front-end and python for the back-end. I'm not sure how to join these bits together, though. Can anyone give me s

Re: [Qt-qml] emit data on a QAbstracListModel does not update the QML ListView.

2010-09-14 Thread Bartosh Wroblevksy
Hello Steve, Thank you for filing the BR. I have a few questions. 1) What's the number of the bug? 2) I have trouble seeing how in this case, moving rows and changing data is not equivalent. In fact,unless my morning coffee was not caffeinated. If I write m_elements[1] ="x"; emit

[Qt-qml] Writing to property alias

2010-09-14 Thread Leonardo Cunha
hi, my question is whether writing to an alias property should override or not any binding existing on the aliased property (currently the binding continues active on the aliased property after writing to the alias property). Here is an example of a component with a property alias, let's call it

Re: [Qt-qml] Accessing dynamic properties

2010-09-14 Thread jamey.hicks
How did you pass in the object? If you pass it as a QVariant you need to cast it to QObject * first to make its slots and properties available. Jamey -Original Message- From: Dzyubenko Denis (Nokia-MS-Qt/Oslo) Sent: 14/09/2010, 11:55 AM To: Hicks Jamey (Nokia-NRC/Cambridge) Cc: qt-qml@t

Re: [Qt-qml] Accessing dynamic properties

2010-09-14 Thread denis.dzyubenko
Hi, On 14. sep. 2010, at 17.29, Hicks Jamey (Nokia-NRC/Cambridge) wrote: > > If variable o is bound to your object, then this will do the trick: > o.foo nope, this just gives me undefined at run-time: console.log("foo = ", myobject.foo) the output: "foo = undefined" Denis. __

Re: [Qt-qml] Accessing dynamic properties

2010-09-14 Thread Stephen Kelly
jamey.hi...@nokia.com wrote: > > If variable o is bound to your object, then this will do the trick: > o.foo > > To update it: > o.foo = newvalue; > > Anecdotal evidence suggests that you cannot assign new dynamic properties > to your object from QML. > I think that's documented too, but I do

Re: [Qt-qml] QSortFilterProxyModel with QML ListView

2010-09-14 Thread Stephen Kelly
Cornelius Hald wrote: > Hi, > > I've now managed to use my own data model together with a customized > QSortFilterProxyModel to provide sorting and searching for my QML UI. I > still have two open questions, though. > > 1) Is there a way to animate sorting? I have animations for inserting > and

Re: [Qt-qml] Accessing dynamic properties

2010-09-14 Thread jamey.hicks
If variable o is bound to your object, then this will do the trick: o.foo To update it: o.foo = newvalue; Anecdotal evidence suggests that you cannot assign new dynamic properties to your object from QML. Jamey On Sep 14, 2010, at 11:16 AM, ext denis.dzyube...@nokia.com wrote:

[Qt-qml] QSortFilterProxyModel with QML ListView

2010-09-14 Thread Cornelius Hald
Hi, I've now managed to use my own data model together with a customized QSortFilterProxyModel to provide sorting and searching for my QML UI. I still have two open questions, though. 1) Is there a way to animate sorting? I have animations for inserting and removing data and they are also used wh

[Qt-qml] Accessing dynamic properties

2010-09-14 Thread denis.dzyubenko
Hi, Is there a way to access dynamic properties from QML? I have a c++ object that does _not_ have a Q_PROPERTY(int foo READ foo), and in c++ I set the value using the setProperty("foo", 42) function call - i.e. a dynamic property. Is there a way to access it from QML? I assume that by default

Re: [Qt-qml] Dummy model for QList model

2010-09-14 Thread Cornelius Hald
On Tue, 2010-09-14 at 16:10 +0200, Stephen Kelly wrote: > Cornelius Hald wrote: > > > Thanks! qmlRegisterType() helped with my own model (derived from > > QAbstractListModel). With QObjectListModel I'm still having a problem, > > because I don't understand how the roles are defined. From looking a

Re: [Qt-qml] "Cheating" in startup.qml?

2010-09-14 Thread Jason H
I installed on windows XP, and my project was in My Documents, so C:\Documents and settings\Jason\My Documents\qmlproject\1stry.qml was passed to the viewer as such, but needed to be: "C:\Documents and settings\Jason\My Documents\qmlproject\1stry.qml" When I moved the qmlproject directory under C:

Re: [Qt-qml] QML/C++ shared QItemSelectionModel

2010-09-14 Thread Stephen Kelly
Carl Snellman wrote: > Hey, > > I have one common QAbstractItemModel that serves data for a ListView > in QML side and for another QGraphicsWidget (a map that shows items). > They use the same data model nicely, but as my goal is to keep the > selection in sync in both views, so I'm trying to get

Re: [Qt-qml] Dummy model for QList model

2010-09-14 Thread Stephen Kelly
Cornelius Hald wrote: > Thanks! qmlRegisterType() helped with my own model (derived from > QAbstractListModel). With QObjectListModel I'm still having a problem, > because I don't understand how the roles are defined. From looking at > the code and the comments it looks like only one role with the

Re: [Qt-qml] emit data on a QAbstracListModel does not update the QML ListView.

2010-09-14 Thread Stephen Kelly
Bartosh Wroblevksy wrote: > > Hi, > > I have an example in attachment and don't see what I am doing wrong. > Essentially, in this example at least, I emit dataChanged in a model in a > cpp file and the QML ListView hooked up to it refuses to update. the qml > file is LibraryList.qmlthe model i

Re: [Qt-qml] "Cheating" in startup.qml?

2010-09-14 Thread Kai Koehne
On 9/8/2010 8:31 PM, ext Jason H wrote: > I downloaded the SDK rc1 for 4.7 > > I wanted to check out the QML stuff, but the QtCreator IDE does not quote the > script name (as a parameter), so I was going to launch it manually, and take > it > from there. Could you elaborate on this one? What exac

Re: [Qt-qml] Dummy model for QList model

2010-09-14 Thread Cornelius Hald
On Tue, 2010-09-14 at 13:58 +0200, Christian Kamm wrote: > On Tuesday 14 September 2010 13:10:12 ext Cornelius Hald wrote: > > On Tue, 2010-09-14 at 01:00 +0200, michael.bras...@nokia.com wrote: > > > Is the above the exact wording of the error message you are seeing? > > > > The error above is th

Re: [Qt-qml] Dummy model for QList model

2010-09-14 Thread Christian Kamm
On Tuesday 14 September 2010 13:10:12 ext Cornelius Hald wrote: > On Tue, 2010-09-14 at 01:00 +0200, michael.bras...@nokia.com wrote: > > Is the above the exact wording of the error message you are seeing? > > The error above is the error I receive from QtCreator. I noticed that I > can still exec

Re: [Qt-qml] Dummy model for QList model

2010-09-14 Thread Cornelius Hald
Hi! On Tue, 2010-09-14 at 01:00 +0200, michael.bras...@nokia.com wrote: > Is the above the exact wording of the error message you are seeing (if so, > what release version are you using)? If the objects in the list are > QtObjects, I get the message "Cannot assign to non-existent property "name"