QTfrontend/hwconsts.cpp.in
changeset 7130 fcab1fd02bc6
parent 6958 8230a516ba93
child 7258 722e8a0d89dc
--- a/QTfrontend/hwconsts.cpp.in	Sat May 26 16:50:51 2012 -0400
+++ b/QTfrontend/hwconsts.cpp.in	Sun May 27 23:42:43 2012 +0400
@@ -16,6 +16,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+#include <QStandardItemModel>
+
 #include "hwconsts.h"
 
 QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}");
@@ -70,3 +72,19 @@
 
 int season = SEASON_NONE;
 int years_since_foundation = 0;
+
+QStandardItemModel * colorsModel;
+
+void hwConstsInit()
+{
+    colorsModel = new QStandardItemModel();
+
+    int i = 0;
+    while(colors[i])
+    {
+        QStandardItem * item = new QStandardItem();
+        item->setData(QColor(colors[i]));
+        colorsModel->appendRow(item);
+        ++i;
+    }
+}