int KBDListener::readPin(){ pin = 0; i = 0; mutex.lock(); start(); waitPin.wait(&mutex); qDebug() << pin; quit(); return pin;}void KBDListener::run(){ connect(imp, SIGNAL(keyPressed(QObject*)), this, SLOT(keyHandler(QObject*))); while(i < 4) { } if ( i == 4){ mutex.unlock(); return; }}void KBDListener::keyHandler(QObject* obj){ pin = pin * 10 + ((QPushButton*)obj)->text().toInt(); ++i;}