Hi everyone. Here's again a question, this time on QSettings with INI files. The question is simple: how do I know if a group exists in my INI file?
Well, I could ask for all groups with childGroups(), and use the contains("theGroupName") method. Except that I don't know why this crashes when used inside a qWarning. This is the very simple INI file: [first] item=2 [last] size=1 This is the super simple code I've written: #include <QSettings> #include <QStringList> int main(int argc, char *argv[]) { QSettings s("/Users/sensei/Desktop/proj.txp", QSettings::IniFormat); bool x = s.childGroups().contains("first"); qWarning("Number of groups: %d", s.childGroups().size()); qWarning("Contains [first]: %d", x); // OK qWarning("Contains [first]: %d", s.childGroups().contains("first")); // BOOM! return 0; } and your .pro file: TEMPLATE = app SOURCES += main.cpp I don't know why this happens. Any hints? I might be missing something SO obvious... Cheers! PS. My environment is OSX 10.8, the qt installation is the one that I installed on the previous OSX version. Qt is 4.8.0 (the SDK Maintenance Tool says I have no updates available). _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest