altarius
27th January 2011, 08:31
Hey,
i got some problems here, but cannot find any answer (googled for a while now)
I'm doing some parallel calculation with QFutureWatcher. Basically it works fine, but if I fetch some global parameters from a file before I start the calculation, the threads of the watcher won't finish anymore.
at the moment I use QSettings to read the file, but it also happened with QFile.
If I remove the code which reads the file it everything works fine.
Am I missing something?
The Code to read the file:
QString fileName=QFileDialog::getOpenFileName(this,tr("load magnets ..."),QDir::homePath(),tr("File (*.ini)"));
if(fileName.length()>0) {
QSettings *settings = new QSettings(fileName,QSettings::IniFormat);
QStringList list_of_magnets = settings->childGroups();
foreach (QString magnet, list_of_magnets) {
settings->beginGroup(magnet);
addMagnet( ... );
settings->endGroup();
}
delete settings;
}
i got some problems here, but cannot find any answer (googled for a while now)
I'm doing some parallel calculation with QFutureWatcher. Basically it works fine, but if I fetch some global parameters from a file before I start the calculation, the threads of the watcher won't finish anymore.
at the moment I use QSettings to read the file, but it also happened with QFile.
If I remove the code which reads the file it everything works fine.
Am I missing something?
The Code to read the file:
QString fileName=QFileDialog::getOpenFileName(this,tr("load magnets ..."),QDir::homePath(),tr("File (*.ini)"));
if(fileName.length()>0) {
QSettings *settings = new QSettings(fileName,QSettings::IniFormat);
QStringList list_of_magnets = settings->childGroups();
foreach (QString magnet, list_of_magnets) {
settings->beginGroup(magnet);
addMagnet( ... );
settings->endGroup();
}
delete settings;
}