[Qt-qml] Relative to absolute paths, and z-order comparison
michael.brasser at nokia.com
michael.brasser at nokia.com
Tue Mar 30 06:02:14 CEST 2010
Hi,
On 30/03/2010, at 6:43 AM, ext mathias.malmqvist at nokia.com wrote:
> 1) Is there a way to turn a relative path/URL into an absolute one? I have two QML
> elements implemented in different folders, and they need to be able to exchange paths
> that are defined relative to each elements implementation folder. (this time they are
> image file paths, so I can just use the Image element's source property after the image
> has been loaded, but this may not always be an option so it would be good to know for
> future reference.)
Qt.resolvedUrl(url) is probably what you are looking for.
> 2) How can I determine which of two random elements is on top in z-order?
> I don't think I can just compare the z-properties, right...? (also, it needs to take the
> elements visibility into account!
That's correct -- unless a z is specifically set, all of the items will have the same z value. WIthin a single z value, stacking is usually based on insertion order (so items appearing later in a QML file will be above those appearing earlier). What are you using the comparison to achieve in QML?
> is a parent's opacity reflected on its children's opacity
> property?)
The opacity property holds the item's own (set) opacity. It is only at paint time that this is combined with the parent's opacity to paint the item at its 'effective opacity'. There is currently no way to access the effective opacity from QML.
Regards,
Michael
More information about the Qt-qml
mailing list