iasdev
12th February 2016, 15:05
Hello I am trying to load my .ini settings back into my UI.
I have the basic form down, from what I read in the QSettings doc and from what I could gather across the web, but I am still failing to understand how to load user saved text back into the UI.
void DLP3Dprinter::saveprogram()
{
QSettings settings("Moose Soft", "Clipper");
settings.beginGroup("MainWindow");
settings.setValue("size", size());
settings.setValue("pos", pos());
settings.setValue("Resolution",ui->StepResolutionText->toPlainText());
settings.endGroup();
}
void DLP3Dprinter::readsettings()
{
QSettings settings("Moose Soft", "Clipper");
settings.beginGroup("MainWindow");
resize(settings.value("size", QSize(400, 400)).toSize());
move(settings.value("pos", QPoint(200, 200)).toPoint());
//settings.setUserData("Resolution",ui->StepResolutionText->toPlainText());
//ui->StepResolutionText->setPlainText(QApplication::translate("DLP3Dprinter"," ?????",0));
// ui->StepResolutionText->setPlainText(settings.value("Resolution"));
settings.endGroup();
I am trying various methods to attain my desired result, but my programming knowledge is limited. Any help would be appreciated. I am sure this is pretty simple, once understood.
Thanks!
I have the basic form down, from what I read in the QSettings doc and from what I could gather across the web, but I am still failing to understand how to load user saved text back into the UI.
void DLP3Dprinter::saveprogram()
{
QSettings settings("Moose Soft", "Clipper");
settings.beginGroup("MainWindow");
settings.setValue("size", size());
settings.setValue("pos", pos());
settings.setValue("Resolution",ui->StepResolutionText->toPlainText());
settings.endGroup();
}
void DLP3Dprinter::readsettings()
{
QSettings settings("Moose Soft", "Clipper");
settings.beginGroup("MainWindow");
resize(settings.value("size", QSize(400, 400)).toSize());
move(settings.value("pos", QPoint(200, 200)).toPoint());
//settings.setUserData("Resolution",ui->StepResolutionText->toPlainText());
//ui->StepResolutionText->setPlainText(QApplication::translate("DLP3Dprinter"," ?????",0));
// ui->StepResolutionText->setPlainText(settings.value("Resolution"));
settings.endGroup();
I am trying various methods to attain my desired result, but my programming knowledge is limited. Any help would be appreciated. I am sure this is pretty simple, once understood.
Thanks!