hazardpeter
23rd July 2009, 00:26
Hello, I'm having a big problem with signals, this is it:
I have many QPushButton and a QLineEdit in a widget witch the class name is myclass, their names are cmd_1, cmd_2 and cmd_3, and txt. They are declared in the class declaration like so:
class myclass: public QWidget
{
Q_OBJECT
public:
myclass(QWidget *parent = 0);
~myclass();
private:
QPushButton *cmd_1;
QPushButton *cmd_2;
QPushButton *cmd_3;
QLineEdit *txt;
}
What I really need is that when you click in one of the buttons, its values, 1, 2 or 3, is written in txt widget. I have spend many many hours trying to use connect with custom signals but I just couldn't do it. I have also spend many hour in google and didn't find the answer for my questions about custom signals and emits and that stuff. For me the connect function is starting to bee a big mindf#ck. Can someone please help me understand this or just give a web link to help me.
Thanks for now and sorry for my not so good english.
I have many QPushButton and a QLineEdit in a widget witch the class name is myclass, their names are cmd_1, cmd_2 and cmd_3, and txt. They are declared in the class declaration like so:
class myclass: public QWidget
{
Q_OBJECT
public:
myclass(QWidget *parent = 0);
~myclass();
private:
QPushButton *cmd_1;
QPushButton *cmd_2;
QPushButton *cmd_3;
QLineEdit *txt;
}
What I really need is that when you click in one of the buttons, its values, 1, 2 or 3, is written in txt widget. I have spend many many hours trying to use connect with custom signals but I just couldn't do it. I have also spend many hour in google and didn't find the answer for my questions about custom signals and emits and that stuff. For me the connect function is starting to bee a big mindf#ck. Can someone please help me understand this or just give a web link to help me.
Thanks for now and sorry for my not so good english.