We figured out how to do it....Here it goes....

QByteArray bArray = s.toLatin1();

const char * ch = bArray.constData();

int m = atoi(ch);

If there is anyother way your welcome to let me know...

Thanks....


Quote Originally Posted by mgurbuz
Hi,
Does anybody know how to convert "-2" string to integer?
I have tried doing it as follows but no success....
Is there anything wrong with the following code???

QString s = "-2";

bool ok;

uint m = s.toUInt( &ok, 10 );

Thank you for any help...