cout replaced with qDebug()