Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting QString to char* [duplicate]

Tags:

People also ask

How to convert QString to char* in c++?

//QLineEdit *line=new QLineEdit();{just to describe what is line here} QString temp=line->text(); char *str=(char *)malloc(10); QByteArray ba=temp. toLatin1(); strcpy(str,ba.

How to convert character to string in Qt?

QString str= QString(*inBuffer[1]); ui->counter->setText(str);

How do I copy a char array to QString?

Re: Char array to QStringperson P; strcpy (P.name,"TESTNAME"); QString MYstring(P.name);


Possible Duplicate:
QString to char conversion

I have a function (fopen in STL) that gives a char* argument as a path in my computer, but I must use QString in that place so it doesn't work.

How can I convert QString to char* to solve this problem?