I have a QLineEdit which I Want to connect to a QLabel so that depending on the validity of the text entered. I have two problems while doing this.
QLineEdit *text = new QLineEdit(this);
layout->addWidget(text, rowno, 0);
QLabel *button = new QLabel(this);
button->setStyleSheet("QLabel { background-color : green; color : white; }");
button->setAlignment(Qt::AlignCenter);
button->setText("OKAY");
QObject::connect(text, SIGNAL(textEdited(const QString &)), button, SLOT(CheckValidity(const QString &)));
this does not connect any changes made in QLineEdit to my custom slot. I cannot figure out why! Also in the custom slot, I want to change the background colour of my label depending on the QString passed. How do I get a reference for the label? It is present as the receiver of the signal but I can't figure out a way to refer to it.