[Qt-qml] Relative to absolute paths, and z-order comparison

mathias.malmqvist at nokia.com mathias.malmqvist at nokia.com
Tue Mar 30 07:30:37 CEST 2010


Hi Michael,

> That's correct -- unless a z is specifically set, all of the items  
> will have the same z value.
[...]
> What are you using the comparison to achieve in QML?


I'm trying to implement drag and drop. In my demo I now have multiple  
elements representing drop areas, and I've found that some overlap. So  
I'm trying to work out which is located above which other.

The problem of determing a child's effective opacity is part of this  
too, but at this point only a theoretical issue in my demo. Would be  
good if it had a solution for the completeness of qml though.

I'll raise the defects if you tell me there's currently no support for  
either of these two issues.

Thanks!



Cheers
Mathias

------------------------------------------------------------
Mathias Malmqvist
CWRT Prototype Lead
S SE UX Prototyping GB
10 Great Pulteney Street, London, W1F 9NB, UK
Got no reply? Try giving me a call:
Mobile: +44 (0)77 6522 2738
http://www.nokia.com

On 30 Mar 2010, at 05:02, "Brasser Michael (Nokia-D-Qt/Brisbane)" <michael.brasser at nokia.com 
 > wrote:

> 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