[Qt-qml] Howto disable a QML Item?
michael.brasser at nokia.com
michael.brasser at nokia.com
Mon Mar 21 07:46:13 CET 2011
Hi,
On 18/03/2011, at 7:19 PM, ext Cornelius Hald wrote:
> On Fri, 2011-03-18 at 09:42 +1000, Alan Alpert wrote:
>> Another approach that might be more general but hard to apply to your
>> situation is to use the Connections element for the signal connections. You
>> can set the target to null when the item is not visible, and then back to the
>> intended target when the item is visible. This may not work for the automatic
>> connections set up by models though.
>
> Thanks for your answer, I'll try this as well. What I don't really like
> with most of those solutions is that I have to put in a lot of
> additional code.
>
> Either I have do something like this is many many places:
> SomeItem {
> text: isCurrentScreen ? backend.activePoi.name : ""
> image: isCurrentScreen ? backend.activePoi.image : ""
> }
>
> Or I have to create a lot of Connection elements to do the same.
Another option might be gathering all these changes up into an "inactive" State that is set when !isCurrentScreen.
> What I
> would like to have would be something like:
>
> MyScreen {
> active: isCurrentScreen
> SomeItem {
> text: backend.actitvePoi.name
> image: backend.activePoi.image
> }
> }
This looks like an interesting idea -- any chance you could add a suggestion at bugreports.qt.nokia.com?
Regards,
Michael
> If 'active == false' all child elements would stop reacting on property
> changes or other signals and animations would stop.
>
> I think especially in combination with 'Qt.application.active' we need a
> way to quickly disable animations and signal handlers. But also we need
> to do this selectively.
>
> For instance, I might want to disable visual updates on a map view, but
> still play a sound once I'm close to a certain location.
>
> Does this make any sense? How do you solve those issues?
>
> Thanks!
> Conny
>
>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
More information about the Qt-qml
mailing list