--Boundary-00=_pubiKAg9myTplMP Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Am Monday 17 August 2009 schrieb Matthew Woehlke: > If you'd like to "one-up" my patch, please feel free :-). Otherwise I'm > not sure what you have in mind. i guess sth. like QRegExp identifier("[A-Za-z0-9_]"); o.objectName().mid(i,1).contains(identifier); Performance ain't crucial here (and QChar::isLetter() just tests some flags), but i just tested and QChar grants ::isLetter to really a lot of stuff (esp. as any utf-8 char seems to be split an the first part becomes a letter, though it's /no/ [A-Za-z] :-( (new test code attached) --Boundary-00=_pubiKAg9myTplMP Content-Type: text/x-c++src; charset="UTF-8"; name="objectnametest.cc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="objectnametest.cc" #include #include #include main (int argc, char **argv) { if (argc < 2) qDebug() << "you forgot the object name"; else { QObject o; o.setObjectName(argv[1]); qDebug() << o.objectName(); QRegExp identifier("[A-Za-z0-9_]"); for (int i = 0; i < o.objectName().length(); ++i) qDebug() << o.objectName().midRef(i,1) << o.objectName().mid(i,1).contains(identifier); } } --Boundary-00=_pubiKAg9myTplMP--