[Qt-qml] MouseArea for an image with transparent parts
henrik.hartz at nokia.com
henrik.hartz at nokia.com
Wed Mar 17 04:04:26 CET 2010
Hi Dom,
On 16. mars 2010, at 23.12, ext Dominic Genest wrote:
> I have been trying Qml very much since the package that was released for
> 4.6.0, and I am very pleased of its syntax and extensibility.
> Congratulations to all developers involved!
>
> One feature I still miss very much, though, is the ability to use images
> with an alpha channel and to have MouseArea s that take transparent
> pixels into account for ignoring clicks on them. I have implemented an
> event filter for that, but it resulted in quite hacky code in which I am
> not completely confident, especially for the hover events part (”enter”
> and “leave” events).
>
> I know rectangle-only parts were chosen for performance considerations,
> but I believe that having that feature as an optional flag (somehow like
> the “smooth” properties) would be a very useful feature. Besides, maybe
> I am missing some important point, but I think there could be a way of
> organising things such that checking the transparency of one pixel in
> each image for which the bounding rectangle coincides with the mouse
> position would lead to very acceptable performances.
>
> What do you think?
Sounds like a useful opt-in feature, but this needs to be carefully evaluated. Could you perhaps write up a new suggestion task at http://bugreports.qt.nokia.com/ using component Declarative? If you have a patch to QtDeclarative you could also add a link to a merge request - but I have to tell you that this is not likely to be considered for the first release as we are mostly focused on stabilizing the current scope.
What's the use-case for having this? Would you use non-rectangular buttons in your UI? Might be possible to find a work-around by knowing the background for this.
Cheers,
Henrik
More information about the Qt-qml
mailing list