[Kde-bindings] Qt, Qyoto buttons work intermediately

linuxoidoz at yahoo.com.au linuxoidoz at yahoo.com.au
Sat Feb 20 15:12:31 UTC 2010

> That sounds more like programming issues in general than Qt issues.
> 1) sounds like a bit of a bad idea in general - more sensible would be
> to have the StartWindow fire an event, have the MainWindow subscribe to
> the event, and then have a method in the MainWindow add the page when
> the event occurs. That way the pages are only concerned with their own
> stuff, not with other things.
> 2) Probably the same - keep things separated so that the page doesn't
> know about the construction of the main window, but use events so that
> the main window can do whatever it needs to.
> Tight coupling, like it sounds like you have, is generally going to
> cause you problems in the long run :)

Well, there may be programming issues, but what I'm trying to figure out is purely Qt - how do you pass a variable in a signal/slot?

In normal C# you would do:

onButtonOKClicked() {
	string str1 = "string";

ChangeText (string str2) {
	txtEdit.Text = str;

but in Qt this doesn't work:

signal(btnOK, SIGNAL("clicked()"), this, SLOT("ChangeText(str1)")); - it says no such slot

This is all I'm trying to figure out - how do you pass a value in a signal/slot?

More information about the Kde-bindings mailing list