hmm.. so that's bad. in old c code i could convert a part of a string doing something like this:
char * str = "code=123";
int value;
sscanf(str+5, "%d", &value);
char * str = "code=123";
int value;
sscanf(str+5, "%d", &value);
To copy to clipboard, switch view to plain text mode
so, there is no extra copy - i simply use the same data that i don't need to change. i'd like to do the same in qt with something like:
int code = s.midRef(5).toInt();
QString s("code=123");
int code = s.midRef(5).toInt();
To copy to clipboard, switch view to plain text mode
but as far as i understood there is no way to do it. it would be great if a QStringRef had such functions or had a QString pointer to the part of data (not to the whole source string)
Bookmarks