[Qt-qml] QML Slot

Ivan De Marino ivan.de.marino at gmail.com
Fri Jul 16 13:58:41 CEST 2010


I do use that.
I'm talking about the scenario that Almo (was Almo?) described: u make ur
object, u expose it as a property in the Context, try to connect to it's
"onWhateverHappened" and you don't get the signal in QML.


On 16 July 2010 12:55, <aaron.kennedy at nokia.com> wrote:

> Hi,
>
> You've never used onClicked?
>
> All signals automatically become "on<Signal Name>" where the first letter
> in the signal is uppercased.  Likewise, all property change notifiers
> automatically become "on<Property Name>Changed" where the first letter in
> the property is uppercased.  To avoid conflicts, properties and signals that
> start with an uppercase letter are ignored.
>
> Anything else is a bug.
>
> Cheers,
>
> Aaron
>
> On 16/07/2010, at 9:37 PM, "ext Ivan De Marino" <ivan.de.marino at gmail.com>
> wrote:
>
> (trying to bring back the main topic of this thread)
>
> I think you can't connect to signals like that if you DON'T use a
> Q_PROPERTY() macro.
>
> At least in my experience, I never managed to connect to a signal into QML,
> if not the ones that are related to Q_PROPERTY-ies.
>
> If anyone finds a solution to this, I'm interested as well.
>
> On 14 July 2010 09:48, Almo Nito < <AlmoNito at gmx.de>AlmoNito at gmx.de>wrote:
>
>> I tryed that with the following Result:
>>
>> Cannot assign to non-existent property "onChangedDir"
>>
>>
>> signals: void ChangedDir();
>> The Object is Registered using
>> ctxt->setContextProperty("CommObject",_COMM);
>>
>> i can access  the functions from QML and access its properties but i can
>> NOT connect to a signal
>>
>> Any Ideas?
>>
>>
>>
>> -------- Original-Nachricht --------
>> > Datum: Wed, 14 Jul 2010 01:37:11 +0200
>> > Von: <michael.brasser at nokia.com>michael.brasser at nokia.com
>> > An: <AlmoNito at gmx.de>AlmoNito at gmx.de
>> > CC: <qt-qml at trolltech.com>qt-qml at trolltech.com
>> > Betreff: Re: [Qt-qml] QML Slot
>>
>> > Hi Almo,
>> >
>> > On 14/07/2010, at 6:30 AM, ext Almo Nito wrote:
>> > I would like to know how i can connect to a Signal in QML if the object
>> > was not instanced from QML:
>> >
>> > Im having an Object _COMM;
>> >
>> > That was registered using:
>> > ctxt->setContextProperty("CommObject",_COMM);
>> >
>> > I can actually use CommObject.doMyInvolkeMethod() in QML
>> >
>> > But how do I connect to a signal that gets emmited that instace of _COMM
>> > in QML?
>> >
>> > You should be able to use the Connections element for this
>> > ( <http://doc.qt.nokia.com/4.7-snapshot/qml-connections.html>
>> http://doc.qt.nokia.com/4.7-snapshot/qml-connections.html):
>> >
>> > Connections {
>> >     target: CommObject
>> >     onMySignal: console.log("here I am!")
>> > }
>> >
>> > Regards,
>> > Michael
>> >
>>
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter <http://portal.gmx.net/de/go/maxdome01>
>> http://portal.gmx.net/de/go/maxdome01
>> _______________________________________________
>> Qt-qml mailing list
>>  <Qt-qml at trolltech.com>Qt-qml at trolltech.com
>>  <http://lists.trolltech.com/mailman/listinfo/qt-qml>
>> http://lists.trolltech.com/mailman/listinfo/qt-qml
>>
>
>
>
> --
>  Ivan De Marino | Software Engineer | France Telecom R&D UK - Orange Labs
>  w. +44 20 8849 5806 | m. +44 7515 955 861 | m. +44 7974 156 216
>  ivan[dot]demarino[at] <http://orange-ftgroup.com>orange-ftgroup.com |
> ivan[dot]de[dot]marino[at]gmail[dot]com
>   <http://www.detronizator.org>www.detronizator.org |
> <http://www.linkedin.com/in/ivandemarino>www.linkedin.com/in/ivandemarino
>
> <ATT00001..txt>
>
>


-- 
 Ivan De Marino | Software Engineer | France Telecom R&D UK - Orange Labs
 w. +44 20 8849 5806 | m. +44 7515 955 861 | m. +44 7974 156 216
 ivan[dot]demarino[at]orange-ftgroup.com |
ivan[dot]de[dot]marino[at]gmail[dot]com
 www.detronizator.org | www.linkedin.com/in/ivandemarino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100716/bd1ba403/attachment.html 


More information about the Qt-qml mailing list