liengen
22nd October 2008, 14:28
Hi!
Having a problem to connect a qlabel and qpushbutton.
Here`s some code:
QLineEdit *lineEdit = new QLineEdit;
QLabel *copied = new QLabel;
QPushButton *copy = new QPushButton("&Copy");
QDialog::connect(copy, SIGNAL(clicked()), copied, SLOT(setText(lineEdit->text())));
QDialog::connect(copy, SIGNAL(clicked()), lineEdit, SLOT(clear()));
The first connect sentence isnt working. I`ve tried with setText("foobar"), but even then nothing happens with the label
Having a problem to connect a qlabel and qpushbutton.
Here`s some code:
QLineEdit *lineEdit = new QLineEdit;
QLabel *copied = new QLabel;
QPushButton *copy = new QPushButton("&Copy");
QDialog::connect(copy, SIGNAL(clicked()), copied, SLOT(setText(lineEdit->text())));
QDialog::connect(copy, SIGNAL(clicked()), lineEdit, SLOT(clear()));
The first connect sentence isnt working. I`ve tried with setText("foobar"), but even then nothing happens with the label