[Kde-bindings] Qt, Qyoto buttons work intermediately

linuxoidoz at yahoo.com.au linuxoidoz at yahoo.com.au
Sat Feb 20 15:33:56 UTC 2010


> 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.



More information about the Kde-bindings mailing list