title: Qt Slots and Signals. Get Slot Receiver Object
body: <p>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.</p>
  
  <pre><code>QLineEdit *text = new QLineEdit(this);
  layout-&gt;addWidget(text, rowno, 0);
  QLabel *button = new QLabel(this);
  button-&gt;setStyleSheet("QLabel { background-color : green; color : white; }");
  button-&gt;setAlignment(Qt::AlignCenter);
  button-&gt;setText("OKAY");
  QObject::connect(text, SIGNAL(textEdited(const QString &amp;)), button, SLOT(CheckValidity(const QString &amp;)));
  </code></pre>
  
  <p>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.</p>