
Originally Posted by
waynew
The problem is (just for Wysota

) qDebug() save color is empty.
If I use .value<QColor>() instead of .toString(), the qDebug() says the color is invalid.
I just want to save the user chosen color to my database and restore it on start up.
Any ideas?
Well, you probably have some errors in your code. See following example, try it and if it works, you messed up your code with QString/QColor etc.
qWarning() << c;
s.setValue("test", c);
QColor cc
= s.
value("test").
value<QColor>
();
qWarning() << cc;
QColor c = QColor(145,23,0);
qWarning() << c;
QSettings s;
s.setValue("test", c);
QColor cc = s.value("test").value<QColor>();
qWarning() << cc;
To copy to clipboard, switch view to plain text mode
Bookmarks