From kde-bindings Sat Feb 20 15:33:56 2010 From: linuxoidoz () yahoo ! com ! au Date: Sat, 20 Feb 2010 15:33:56 +0000 To: kde-bindings Subject: Re: [Kde-bindings] Qt, Qyoto buttons work intermediately Message-Id: <201002210133.56744.linuxoidoz () yahoo ! com ! au> X-MARC-Message: https://marc.info/?l=kde-bindings&m=126668009001175 > Nope, it's the same in Qt. To be more precise, in C# you would do (pseudo- > code): > > button.Clicked += onButtonOkClicked; > ... > onButtonOkClicked() { > ChangeText(str1); > } > ChangedText(string str) { > txtEdit.Text = str; > } > > In Qt it's exactly the same: > > Connect(button, SIGNAL("clicked()"), this, SLOT("onButtonOkClicked()"); > ... > onButtonOkClicked() { > ChangeText(str1); > } > ChangedText(string str) { > txtEdit.Text = str; > } > > What you were trying to do with your Connect() statement above is similar to > doing this in C#: > > button.Clicked += onButtonOkClicked(myStringHere); > > which will obviously NOT work. > Remember, connecting signals and slots is just the same as subscribing to a C# > event. > > Oooooooooooooh, NOW I got it! Why didn't you tell me of "button.Clicked += onButtonOkClicked;" before? Now it makes all sense. Thank you, guys. I should take it from here. Thanks a lot again. _______________________________________________ Kde-bindings mailing list Kde-bindings@kde.org https://mail.kde.org/mailman/listinfo/kde-bindings