[Solved] Program exited with code -1073741819
-
wrote on 1 Oct 2012, 16:02 last edited by
Hi all!
I am just trying to save QCheckBox state with QSettings.
this is the code
@void Set::readSettings()
{
QSettings settings("CStudioS", "test1");
QPoint pos = settings.value("pos", QPoint(200,200)).toPoint();
bool check = settings.value("check", true).toBool();
move(pos);
checkBox->setChecked(check); // debuger says an error in here
}void Set::writeSettings()
{
QSettings settings("CStudioS", "test1");
settings.setValue("pos", pos());
settings.setValue("check", checkBox->isChecked());
}void Set::closeEvent(QCloseEvent *event)
{
writeSettings();
event->accept();
}@But i'm getting an error and program exited with code -1073741819.
Help me! thanks
-
wrote on 1 Oct 2012, 16:06 last edited by
Sorry. My bad! I had called readSetting() function before checkBox initialized . Sorry again. Problem solved!
-
wrote on 1 Oct 2012, 18:04 last edited by
Glad you got it working. Be sure and edit your initial post to add [Solved] to the title. Thanks!
3/3