Ah, funny bug: if (!file.open (IO_ReadOnly)) // didn't work QTextStream stream ( &file ); .... while( !stream.eof() ) { stream is only declared in the "if-block" scope. The same like this. if (!file.open (IO_ReadOnly)) QTextStream stream ( &file ); .... while( !stream.eof() ) { or if (!file.open (IO_ReadOnly)) { QTextStream stream ( &file ); } .... while( !stream.eof() ) { would produce an error :-)
QFile file("/etc/hildon/theme/colors.config"); QTextStream stream ( &file ); QString line; QHash<QString, QString> variables; while( !stream.atEnd()) { line = stream.readLine(); QStringList splittedLine = line.split("="); variables.insert(splittedLine.at(0), splittedLine.at(1)); } file.close(); QString oldfont1 = variables.value("DefaultTextColor");