QTfrontend/gameuiconfig.cpp
branch0.9.19
changeset 8924 13ac59499066
parent 8902 a94c074fd483
parent 8920 caa614af152d
child 9054 707e40076be6
--- a/QTfrontend/gameuiconfig.cpp	Sat Apr 20 02:17:53 2013 +0200
+++ b/QTfrontend/gameuiconfig.cpp	Sat Apr 20 02:20:15 2013 +0200
@@ -25,6 +25,7 @@
 #include <QNetworkProxy>
 #include <QNetworkProxyFactory>
 #include <utility>
+#include <QVariant>
 
 #include "gameuiconfig.h"
 #include "hwform.h"
@@ -156,7 +157,7 @@
     { // load colors
         QStandardItemModel * model = DataManager::instance().colorsModel();
         for(int i = model->rowCount() - 1; i >= 0; --i)
-            model->item(i)->setData(value(QString("colors/color%1").arg(i), model->item(i)->data()));
+            model->item(i)->setData(QColor(value(QString("colors/color%1").arg(i), model->item(i)->data()).toString()));
     }
 
     { // load binds
@@ -319,7 +320,7 @@
     { // save colors
         QStandardItemModel * model = DataManager::instance().colorsModel();
         for(int i = model->rowCount() - 1; i >= 0; --i)
-            setValue(QString("colors/color%1").arg(i), model->item(i)->data());
+            setValue(QString("colors/color%1").arg(i), model->item(i)->data().value<QColor>().name());
     }
 
     sync();