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: QUOTING

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 prop

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

2010-11-27 Thread Charley Bay
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 the previous implementation, I had "instanti

[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: For example, I did: (a) Implement C++ class MyAttachedProperties, derived from QObject (b) Implement static function and QM

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? > QDeclarativeItem::boundingRect()> > Was your C++ code inside an application-derived QDeclarativeItem::itemChange()? I'm Qt4.7.0, Win7-64bit, MSVC++2008. I tried it again to make sure there was no dif

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

2010-11-25 Thread Charley Bay
> > > For example, QML has "anchors", and you *can* do layout very easily, and > > even parent-item-resizing-based-on-child. However, layout is > fundamentally > > "wrong" when you start moving into "states" and "transitions". Layout > > fundamentally "fights" your ability to do rich presentation

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 attrib

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

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

2010-11-24 Thread Charley Bay
> > 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 with properties exposed through the metaobject system

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? > > 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) I

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

2010-11-24 Thread Charley Bay
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 QObject with properties, how does QML expose attr

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

Re: [Qt-qml] Static analysis for QML

2010-11-24 Thread Charley Bay
Gregory spaketh: > > , > > 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:

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

2010-11-22 Thread Charley Bay
I'm sure the answer is simple, but I can't find it: I want my C++ implemented QML object to be notified when children are added: //FILE: MyFile.qml import Qt 4.7 import MyCppClass 1.0 Rectangle { MyCppClass { id: myCppClass Text { text: "some text" } // CHILD NOT DETECTED AS ADDED

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 >

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: Update, I'm still working with animations, and getting interesting behavior. (Would like to see this ticket closed, unsure if current

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

Re: [Qt-qml] QtQuick not installed

2010-11-08 Thread Charley Bay
Mark spaketh: > thanks for all responses. Same error...Attached is my simple qml. What > did I do wrong? > > Instead of your line: import QtQuick 4.7// NO ...use this line: import Qt 4.7 // YES (Later, after the next QtCreator release, you'll change it to): import QtQuick 1.0 // LA

Re: [Qt-qml] QtQuick not installed

2010-11-08 Thread Charley Bay
Mark spaketh: > I am fairly new to QML. > I just did a simple Rectangle but QmlViewer says "module "QtQuick" is not > installed on the line "import QtQuick 1.0". > > Isn't QtQuick module pretty basic? I am on a macbook, is there anything I > need to set in the environment? > > For now, use "imp

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. ;-)) --charley ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml

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 > b

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 com

[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* m

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 t

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 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 again? Thanks! --charley __

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

2010-11-04 Thread Charley Bay
tion (the first one I use its ID, the second one I use "parent"). And > it fails silently in the second case. > > Interesting ... > WRT to your example: > > On Wed, Nov 3, 2010 at 10:16 PM, Charley Bay wrote: > >> >> //FILE: MyParallelAnimation.qml &

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

2010-11-03 Thread Charley Bay
Eduardo respondeth: In what fashion are you using your animation? I'm asking that because in > Quick you can use animations in several ways, to name a few: > > - Inside a Behavior > - Inside a Transition > - As a stand-alone element you explicitly call start and stop > - As an event handler onCl

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 C:\Qt\4.7.0\examples

[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 previo

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 reall

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("--");

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

2010-10-30 Thread Charley Bay
>>charley spaketh: >> >Michael respondeth: > Yes, it should work 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 want to get opinions on whether my solution is

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 Qt

[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] 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

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: Wha

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. > > > However when I write the value, using : > ... > QObject *myTypeA = component.create() > typeAProperty

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

2010-10-23 Thread Charley Bay
The QML docs state: > Property bindings are the most common use of JavaScript in QML. > Property bindings associate the result of a JavaScript expression > with a property of an object. ...found at: IMHO, this is one of the most pivotal conce

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 < myI

[Qt-qml] Animated text halo: How to animate?

2010-10-19 Thread Charley Bay
I'm trying to create QML code that rotates text in an apparent "halo" (like around a circle/sphere). This should be easy, but I can't figure out how to animate aspects of a "transform: Rotation" For example, the following displays text that properly "rotates" back-and-forth, but I want to dynamic

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

2010-10-16 Thread Charley Bay
, > instead, have: > > QDeclarativeView >-Desktop-Widget-Canvas >-QDeclarativeItem >-QDeclarativeItem >-QDeclarativeItem Ah, that makes sense: One "convenience" QDeclarativeView, and I'll instantiate my QDeclarativeEngine, QDeclarativeContext, and QDeclarativeItem inst

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 mode

[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):

Re: [Qt-qml] "Hello World" C++ Model on QML Flow?

2010-10-10 Thread Charley Bay
> What is QML Flow? Do you mean ListView? I should have clarified, "QML Flow element": Funny you should say that -- I wanted Flow, didn't know it existed, started to write my own, then found that it was *included* in the standard library! ;-) Anyway,

[Qt-qml] Home for shared QML snippets?

2010-10-09 Thread Charley Bay
I remember reading months ago some discussion about one-or-more web locations for hosting shared QML snippets. Since I wasn't using QML then, I didn't pay attention as to the conclusion (and now can't find the reference). Is anyone hosting shared QML snippets? An aside: I realize not a lot of pe

[Qt-qml] "Hello World" C++ Model on QML Flow?

2010-10-06 Thread Charley Bay
I'm *very* impressed with QML -- this is absolutely the "right" way to build GUIs in this world of sophisticated user expectation on varied platforms. Annoyingly, this means I've got to totally re-wire my brain for how to think about GUIs. I'm willing to do it -- I'm sold -- but this has been a r