QString ss = ui->lineEdit->text();QByteArray gg;gg = ss.toAscii();
QByteArray Class::QStringToQByteArray(const QString infile ){ QByteArray outfile; unsigned char in; int x; x = 0; while (x<=infile.length()) { in = infile[x].toAscii(); outfile+=in; x++; }return outfile;}
QString ss = ui->lineEdit->text();QTextCodec::setCodecForCStrings(QTextCodec::codecForName("cp1251"));QByteArray buf_in;buf_in = ss.toAscii();