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
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
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
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
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
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,
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
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
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
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
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
*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
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
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
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
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
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
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
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
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
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
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
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
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
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(--);
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
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
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).
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
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()
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
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
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,
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
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):
35 matches
Mail list logo