Restoring previous session of an application
-
Posting in this timeline:
- 2 hours, 36 minutes ago
- 2 hours, 19 minutes ago
- 22 minutes ago
Do you really expect being taken serious when crying like a childish kiddie? Come on, get serious!
-And look at your code if it is ever able to do what you expect it to do!-
-Or better: Use a debugger, set breakpoints and step through the code. You will find the error yourself then within seconds.-
-Hopefully nobody will tell you the solution here, as it has no learning effect.-
EDIT: wrong read of code, sorry
-
hello Volker,I am sorry,I didnt get your meaning..
Hello gerolf, from yesterday i am reading the docs..
this has been given@QSettings settings("MySoft", "Star Runner");
QColor color = palette().background().color();
settings.setValue("DataPump/bgcolor", color);@
//here i didnt understand "DataPump/bgcolor"..regards
imrrk -
[quote author="imrrk" date="1306387710"]hello Volker,Can u give me some hints then..[/quote]
To quote myself:
[quote author="Volker" date="1306322983"]I personally would do something with the color read from the settings....[/quote]
Oh, and that debugger thingie likes breakpoints, you know...
I would be alarmed if it did not stop at a certain point....
-
hello volker problem solved..now i m able to set colors..and save it in .ini file
@void MainWindow::writeSettings()
{
QSettings settings;//("company name", "project");settings.beginGroup("pushbutton");
settings.setValue("size", size());
settings.setValue("pos", pos());
settings.setValue("mytext",ui->pushButton->styleSheet());
settings.setValue("mytext1",ui->pushButton_2->styleSheet());
settings.setValue("mytext2",ui->pushButton_3->styleSheet());
//QColor r("red");
//r.name();//settings.setValue("color",r.name());
settings.setValue("state", saveState());
qDebug()<<r.name();
settings.endGroup();
}void MainWindow::readSettings()
{
QSettings settings;//("Plackal", "restoreproject");settings.beginGroup("pushbutton");
resize(settings.value("size", QSize(400, 400)).toSize());
move(settings.value("pos", QPoint(200, 200)).toPoint());
a=settings.value("mytext").toString();
b=settings.value("mytext1").toString();
c=settings.value("mytext2").toString();
//ui->pushButton->setText(a);
//QColor r=settings.value("color").toString();
ui->pushButton->setStyleSheet(a);
ui->pushButton_2->setStyleSheet(b);
ui->pushButton_3->setStyleSheet(c);
//ui->pushButton->autoFillBackground(r);
QByteArray state = settings.value("state", QByteArray()).toByteArray();
restoreState(state);
//resize(size);
//move(pos);
qDebug("set");
settings.endGroup();}@
regards
imrrk