Re: [Qt-qml] How to think about Attached Properties?

2010-12-01 Thread Charley Bay
charley asketh: (1) Logically, should the state for MyAttachedProperties simply reside within the QObject meta-object system (e.g., through the QObject (base) property()/setProperty())? Or, can I have my own state in data members for MyAttachedProperties that I expose as properties, or

Re: [Qt-qml] How to think about Attached Properties?

2010-12-01 Thread Charley Bay
Ok, follow-up, I'm still trying to understand setting properties in the QObject::setProperty() meta-object system versus exposing a data member as a property (and how these options relate to attached properties). Reading the QML docs: http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html QUOTING

Re: [Qt-qml] C++ MyClass to detect child added/removed from QML

2010-11-27 Thread Charley Bay
snip, boundingRect() not working as expected? Ummm... sorry to add confusion, but it is possible (seems likely to me) that I observed an order of operations on initialization problem ... I've re-structured my code, and now *both* the boundingRect() and width/height properties work properly. In

Re: [Qt-qml] C++ MyClass to detect child added/removed from QML

2010-11-26 Thread Charley Bay
Girish spaketh: boundingRect() works as I would expect. Can you provide some sample code? snip, example extracting good coordinates from QDeclarativeItem::boundingRect() Was your C++ code inside an application-derived QDeclarativeItem::itemChange()? I'm Qt4.7.0, Win7-64bit, MSVC++2008. I

[Qt-qml] How to think about Attached Properties?

2010-11-26 Thread Charley Bay
I'm implementing attached properties on my custom C++ type (exposed to QML), and am unsure about the proper use model: http://doc.qt.nokia.com/4.7/qml-extending.html For example, I did: (a) Implement C++ class MyAttachedProperties, derived from QObject (b) Implement static function and

Re: [Qt-qml] Static analysis for QML

2010-11-24 Thread Charley Bay
Gregory spaketh: snip, So I was wondering, would it be possible, from a technical point of view (not a product manager / roadmap POV), to have some kind of static analysis tool that could tell at compile time that some signal / slots names have changed ? Christian respondeth: Yes,

Re: [Qt-qml] How QML file is parsed and linked and executed?

2010-11-24 Thread Charley Bay
Matti spaketh: With this kind of dynamic programming environment it might be a fragile development practice to rely on the assumption that the framework will load elements in the same order all the way now and in the future. Aaron respondeth: This is some sagely advice. When I say

Re: [Qt-qml] C++ MyClass to detect child added/removed from QML

2010-11-24 Thread Charley Bay
snip, detect parent/child changes from QML in C++ Martin spaketh: QGraphicsItem::itemChange() may do what you want: http://doc.qt.nokia.com/4.7-snapshot/qgraphicsitem.html#itemChange Works great! Thanks! Related question: Now that I'm in the QGraphicsItem world, which is *not* a

Re: [Qt-qml] Simple theming support for QML?

2010-11-24 Thread Charley Bay
Matti spaketh: Has anyone implemented simple theme functionality for their QML apps? snip I started my own theme infrastructure, but gave up when I ran into issues computing sizes for text (e.g., QML does not yet have font metrics exposed) http://bugreports.qt.nokia.com/browse/QTBUG-9712 I

Re: [Qt-qml] C++ MyClass to detect child added/removed from QML

2010-11-24 Thread Charley Bay
Ok, update, I couldn't wait to try this out (results below): charley spaketh: Related question: Now that I'm in the QGraphicsItem world, which is *not* a QObject with properties, how does QML expose attributes (since those are *all* properties based)? Giresh respondeth: QML works

Re: [Qt-qml] Simple theming support for QML?

2010-11-24 Thread Charley Bay
So, MyTheme.qml is my not-so-great stand-in until I can find something good, or can implement a good one. Is that a publicly available example? It's kind of a mess, because I can't decide if it's better to centralize this in a single MyTheme file, or distribute logical attributes across

Re: [Qt-qml] Top-level Animation element, not pauseable/stoppable?

2010-11-20 Thread Charley Bay
*bump* (re-awake topic) I think I can't have what I want, and am looking for confirmation from this list: WHAT I WANT (LOGICALLY): SequentialAnimation { id: myTopLevelAnimation // pause and resume at this level required SequentialAnimation { id: myCountDownDelay loops: 1

Re: [Qt-qml] Top-level Animation element, not pauseable/stoppable?

2010-11-14 Thread Charley Bay
Apologies to Eduardo, I replied directly to him from his email off-list, but meant to send it to the list as a follow-up (so here it is again): FIRST UPDATE: snip, pause/resume for nested animations in top-level animation, including open ticket QTBUG-15083 Update, I'm still working with

Re: [Qt-qml] Managing declarative/imperative order of operations

2010-11-11 Thread Charley Bay
Michael spaketh: This reminds me a bit of http://bugreports.qt.nokia.com/browse/QTBUG-11712-- do you think this may be related to what you are seeing? Do you have any small examples of strange out-of-order behaviors you could share (I'd like to understand the problem better)? I spent some

Re: [Qt-qml] How to spawn N8 Apps from within QML?

2010-11-08 Thread Charley Bay
Niels spaketh: Seems like QtQuick/QML ought to have a declarative subprocess facility as well. (Or maybe it does and i didn't see it documented anywhere?) This would allow launching of subprocesses asynchronously, using declarative statements to handle changing application state based on

Re: [Qt-qml] How to spawn N8 Apps from within QML?

2010-11-08 Thread Charley Bay
Martin spaketh: So who will add the suggestion? I win. ;-)) http://bugreports.qt.nokia.com/browse/QTCOMPONENTS-236 --charley ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml

Re: [Qt-qml] Managing declarative/imperative order of operations

2010-11-07 Thread Charley Bay
Quick update to avoid confusion: *- The example code was to illustrate the issue, I shouldn't have appended the trailing ';' on my elements in the QML files (C++ habit, sorry) *- My suggestion of using some kind of onLoadCompleted() was metaphorical, I meant for that to imply some discrete

[Qt-qml] Managing declarative/imperative order of operations

2010-11-06 Thread Charley Bay
Using QML/Javascript, quite a few options exist to *either* be declarative (e.g., myAnimation.paused = true) or imperative (e.g., myAnimation.pause();) IMHO, when possible, one should be declarative (long discussion for a different thread). However, we all probably agree that we *sometimes* must

Re: [Qt-qml] Top-level Animation element, not pauseable/stoppable?

2010-11-05 Thread Charley Bay
Update, I've found a work-around, which is to explicitly set paused to each of the nested SequentialAnimation instances. However, since the docs explicitly say you shouldn't need to do this (setting paused/running property on the parent ParallelAnimation or SequentialAnimation should propagate to

Re: [Qt-qml] Property Bindings *within* Javascript?

2010-11-04 Thread Charley Bay
Sorry, this isn't the place, but I can't find an administrative contact for bugreports.qt.nokia.com and I have problems with my account (e.g., can't log in and can't change password, but account exists). Administrators, please email me offline, or reset/delete the account so I can create it

[Qt-qml] Top-level Animation element, not pauseable/stoppable?

2010-11-03 Thread Charley Bay
From the QML docs, it appears the pause/resume and start/stop properties for Animation elements are related (setting one influences the other), and I appreciate the (helpful) messages in the console.log() from within the QML libraries when you attempt to resume an animation that was not previously

Re: [Qt-qml] Editor example Source Code

2010-11-03 Thread Charley Bay
Mike spaketh: Where do i find The source code for the getting started programming with qml Tutorial ? On my install (win-commercial), I found it easiest to directly navigate to the following directories and look around: C:\Qt\4.7.0\examples\declarative\tutorials

Re: [Qt-qml] Property Bindings *within* Javascript?

2010-11-02 Thread Charley Bay
Mathias spaketh: Did you post that suggestion? I couldn't find it so I posted it for you http://bugreports.qt.nokia.com/browse/QTBUG-14964 Thanks! I set up an account to enter the ticket, but it was over the weekend when they took the site down for maintenance. Somehow, I'm now in a really

Re: [Qt-qml] Set custom property in onChildrenChanged?

2010-10-30 Thread Charley Bay
charley spaketh: snip, set custom property in onChildrenChanged Michael respondeth: Yes, it should work snip Yes, it works, it was my error. What I'm doing is a little more complicated, and there was enough obfuscation for me to confuse myself. ;-) I now have something that works, but I

Re: [Qt-qml] Set custom property in onChildrenChanged?

2010-10-30 Thread Charley Bay
Ooops, typo (on parent name), that inserted code to inspect each property within a child (more complete example with pre-pended index) should be: Item { id: myParent onChildrenChanged: { for(var i = 0; i myParent.children.length; ++i) { console.log(--);

[Qt-qml] Set custom property in onChildrenChanged?

2010-10-26 Thread Charley Bay
Curious problem, this should work, right? //FILE: MyRect.qml Rectangle { property double myDouble: 0 } //FILE: MyParent.qml Item { id: myParent onChildrenChanged: { for(var i = 0; i myParent.children.length; ++i) { // Error: Cannot assign to non-existent property myDouble

Re: [Qt-qml] Set custom property in onChildrenChanged?

2010-10-26 Thread Charley Bay
Aaron spaketh: Shouldn't the access line read    myParent.children[i].myDouble = 1.0 ? Ooops, yes: I incorrectly re-typed it in the email with the extra '.' (but the problem still exists in my code). Thanks! --charley ___ Qt-qml mailing list

Re: [Qt-qml] Property Bindings *within* Javascript?

2010-10-25 Thread Charley Bay
charley spaketh: However, I'm trying to figure out how to *set* such a binding *within* javascript.  Can this be done? Michael respondeth: There is currently no API for establishing a binding from within javascript (PropertyChanges is currently the only way to set a binding after-the-fact).

Re: [Qt-qml] Custom QML components

2010-10-24 Thread Charley Bay
Adriano spaketh: I've added a small project in the open components: http://gitorious.org/qmlarsenal http://developer.qt.nokia.com/wiki/QtQuickOpenComponents It can be useful for someone. Thanks for posting -- more ideas/examples would help a lot with QML adoption, IMHO. Question: What is

Re: [Qt-qml] QDeclarativeProperty and custom qml types.

2010-10-23 Thread Charley Bay
Simon spaketh: I'm having trouble with assigning qml item properties in C++. The type is declared in qml as a component, and is declared in another qml component as an item property. snip, QML and C++ code However when I write the value, using : ... QObject *myTypeA = component.create()

Re: [Qt-qml] Apply Transform to Item in onChildrenChanged?

2010-10-22 Thread Charley Bay
Hi, Michael-- Charley spaketh: I wrote my own layout type class by hooking into onChildrenChanged which is triggered on parent changed, and it works great: Item {    id: myItem     onChildrenChanged: {      myItem.myUpdateChildrenPlacement()     }     function

[Qt-qml] Apply Transform to Item in onChildrenChanged?

2010-10-21 Thread Charley Bay
I wrote my own layout type class by hooking into onChildrenChanged which is triggered on parent changed, and it works great: Item { id: myItem onChildrenChanged: { myItem.myUpdateChildrenPlacement() } function myUpdateChildrenPlacement() { for(var i= 0; i

Re: [Qt-qml] How to display QDeclarativeComponent created from C++?

2010-10-16 Thread Charley Bay
snip, not have multiple QDeclarativeView instances, instead, have: QDeclarativeView -Desktop-Widget-Canvas -QDeclarativeItem -QDeclarativeItem -QDeclarativeItem Ah, that makes sense: One convenience QDeclarativeView, and I'll instantiate my QDeclarativeEngine,

Re: [Qt-qml] QML model handling

2010-10-13 Thread Charley Bay
michael spaketh: One of the things we're researching now that 4.7 is out the door is how we work with data sets in QML. Part of that is researching next generation model classes for QML Outstanding. I *love* your list. In particular, I vote for: (1) Allowing easy creation of custom models

[Qt-qml] How to display QDeclarativeComponent created from C++?

2010-10-11 Thread Charley Bay
I've been using QDeclarativeView to display QML files launched from C++. Works great. However, the docs seem to suggest that although QDeclarativeView can be used in production applications, the developer may want to avoid creating too many of them (to avoid performance problems):