checking in example; variations on List Widgets
authorJohn Kern <johnk@symbian.org>
Fri, 03 Sep 2010 10:38:13 -0700
changeset 42 b9716e8867f1
parent 41 b56d7e268634
child 43 105a16347b5a
checking in example; variations on List Widgets
ListElements/EasyStreet/EasyStreet.pro
ListElements/EasyStreet/main.cpp
ListElements/EasyStreet/mainwindow.cpp
ListElements/EasyStreet/mainwindow.h
ListElements/EasyStreet/mainwindow.ui
ListElements/ModelViewList/assets.qrc
ListElements/ModelViewList/images/Aquarius.svg
ListElements/ModelViewList/images/Aries.svg
ListElements/ModelViewList/images/Cancer.svg
ListElements/ModelViewList/images/Capricorn.svg
ListElements/ModelViewList/images/Gemini.svg
ListElements/ModelViewList/images/Leo.svg
ListElements/ModelViewList/images/Libra.svg
ListElements/ModelViewList/images/Pisces.svg
ListElements/ModelViewList/images/Sagittarius.svg
ListElements/ModelViewList/images/Scorpio.svg
ListElements/ModelViewList/images/Taurus.svg
ListElements/ModelViewList/images/Virgo.svg
ListElements/ModelViewList/listElements.pro
ListElements/ModelViewList/main.cpp
ListElements/ModelViewList/mainwindow.cpp
ListElements/ModelViewList/mainwindow.h
ListElements/ModelViewList/mainwindow.ui
ListElements/ModelViewList/zodiacdelegate.cpp
ListElements/ModelViewList/zodiacdelegate.h
ListElements/ModelViewList/zodiacmodel.cpp
ListElements/ModelViewList/zodiacmodel.h
ListElements/ModelViewList/zodiacsign.cpp
ListElements/ModelViewList/zodiacsign.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/EasyStreet/EasyStreet.pro	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-08-31T11:46:44
+#
+#-------------------------------------------------
+
+QT       += core gui
+
+TARGET = EasyStreet
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+        mainwindow.cpp
+
+HEADERS  += mainwindow.h
+
+FORMS    += mainwindow.ui
+
+CONFIG += mobility
+MOBILITY = 
+
+symbian {
+    TARGET.UID3 = 0xe534ca73
+    # TARGET.CAPABILITY += 
+    TARGET.EPOCSTACKSIZE = 0x14000
+    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/EasyStreet/main.cpp	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,17 @@
+#include <QtGui/QApplication>
+#include <QListWidget>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+
+#if defined(Q_WS_S60)
+    w.showMaximized();
+#else
+    w.show();
+#endif
+
+    return a.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/EasyStreet/mainwindow.cpp	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,31 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include <QMessageBox>
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+    birds << "Avocet" << "Sparrow" << "Crow" << "Sea gull" << "Kookaburra";
+    birdList = new QListWidget;
+    setCentralWidget(birdList);
+    birdList->addItems(birds);
+    connect(birdList, SIGNAL(itemClicked ( QListWidgetItem * )),
+               this, SLOT(displayBird(QListWidgetItem *)));
+}
+
+void MainWindow::displayBird ( QListWidgetItem * item )
+{
+     QMessageBox::information(this,"picked", item->text());
+}
+
+//void MainWindow::on_birdList_itemClicked(QListWidgetItem *item)
+//{
+//    QMessageBox::information(this, "long", item->text());
+//}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/EasyStreet/mainwindow.h	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,30 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include <QListWidget>
+#include <QStringList>
+
+namespace Ui {
+    class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+
+public slots:
+    void displayBird( QListWidgetItem * item );
+    // void on_birdList_itemClicked(QListWidgetItem * );
+private:
+    QStringList birds;
+    QListWidget *birdList;
+    Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/EasyStreet/mainwindow.ui	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>360</width>
+    <height>640</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <widget class="QListWidget" name="listWidget">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>371</width>
+      <height>601</height>
+     </rect>
+    </property>
+   </widget>
+  </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/assets.qrc	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,16 @@
+<RCC>
+    <qresource prefix="/">
+        <file>images/Taurus.svg</file>
+        <file>images/Aries.svg</file>
+        <file>images/Cancer.svg</file>
+        <file>images/Gemini.svg</file>
+        <file>images/Leo.svg</file>
+        <file>images/Scorpio.svg</file>
+        <file>images/Aquarius.svg</file>
+        <file>images/Capricorn.svg</file>
+        <file>images/Libra.svg</file>
+        <file>images/Pisces.svg</file>
+        <file>images/Sagittarius.svg</file>
+        <file>images/Virgo.svg</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Aquarius.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="280pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg668"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\aquarius.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs669"><style
+   type="text/css"
+   id="style670"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(6.99342,0,0,6.984468,-23594.91,-32470.79)"><path
+   class="fil0"
+   d="M2720 6184l753 -497 165 385 583 -385 163 385 584 -385 241 567 -156 69 -161 -385 -586 385 -163 -385 -581 385 -164 -385 -586 385 -92 -139zm1 -1037l753 -498 165 385 584 -385 163 385 583 -385 241 567 -156 69 -161 -385 -587 385 -163 -385 -581 385 -162 -385 -586 385 -93 -138z"
+   id="path672" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Aries.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="198pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg602"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\aries.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs603"><style
+   type="text/css"
+   id="style604"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(4.487579,0,0,4.505588,-8862.027,-12858.95)"><path
+   class="fil0"
+   d="M2796 5449l0 -134c0,-257 -26,-543 -77,-857 -52,-315 -115,-572 -189,-771 -162,-432 -336,-648 -523,-648 -83,0 -151,36 -204,109 -52,73 -78,167 -78,284 0,154 49,313 149,477l-203 0c-98,-177 -147,-343 -147,-497 0,-160 46,-292 138,-398 92,-106 208,-160 347,-160 225,0 415,151 573,454 157,301 256,706 297,1215l34 0c34,-498 132,-901 292,-1208 160,-307 354,-461 579,-461 139,0 254,53 346,158 92,104 138,236 138,396 0,155 -49,322 -146,501l-204 0c99,-177 149,-339 149,-488 0,-119 -26,-215 -77,-289 -52,-73 -120,-110 -205,-110 -181,0 -350,202 -506,604 -80,205 -146,471 -201,798 -54,326 -81,626 -81,899l0 126 -201 0z"
+   id="path606" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Cancer.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="240pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg626"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\cancer.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs627"><style
+   type="text/css"
+   id="style628"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(5.828176,0,0,5.82271,-19181.62,-26091.57)"><path
+   class="fil0"
+   d="M2720 6219l0 -218c420,192 827,287 1219,287 257,0 466,-33 627,-100 -102,-52 -179,-118 -230,-197 -51,-79 -77,-172 -77,-279 0,-140 51,-260 152,-361 100,-100 222,-150 362,-150 140,0 259,50 359,149 99,100 149,219 149,360 0,223 -136,409 -409,557 -273,148 -615,222 -1026,222 -356,0 -731,-89 -1126,-270zm1674 -506c0,102 37,190 112,264 74,74 164,111 267,111 104,0 192,-37 265,-108 72,-72 108,-160 108,-264 0,-106 -36,-196 -109,-270 -73,-74 -161,-111 -265,-111 -105,0 -194,37 -268,111 -73,73 -110,162 -110,267zm887 -961l0 218c-421,-192 -827,-288 -1220,-288 -256,0 -466,33 -628,101 104,52 181,118 231,197 52,79 77,172 77,279 0,140 -50,260 -151,361 -101,100 -222,150 -363,150 -140,0 -259,-49 -358,-149 -99,-99 -149,-219 -149,-359 0,-224 136,-411 409,-559 272,-148 615,-222 1026,-222 356,0 731,90 1126,271zm-1674 506c0,-103 -37,-191 -112,-265 -75,-73 -165,-110 -269,-110 -104,0 -192,36 -264,108 -72,72 -108,160 -108,264 0,106 37,196 110,270 72,74 161,111 265,111 104,0 194,-37 267,-111 74,-74 111,-163 111,-267z"
+   id="path630" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Capricorn.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+	"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   width="197pt"
+   height="188pt"
+   viewBox="0 0 8268 11692">
+   <g transform="matrix(4.75426,0,0,4.752845,-14923.45,-21059.85)">
+	<path d="M3212 5895l0 -70c0,-131 -23,-314 -68,-552 -46,-238 -88,-394 -127,-468 -55,-105 -141,-158 -259,-158l-38 0 0 -165 150 0c141,0 238,55 292,165 64,133 122,353 175,661 76,-340 202,-615 380,-826l265 -51c65,147 119,368 162,663l37 245c12,86 20,147 24,183 16,147 37,258 61,333 129,-247 308,-371 536,-371 137,0 254,48 350,142 97,94 145,209 145,344 0,144 -49,268 -146,368 -98,101 -217,151 -357,151 -191,0 -358,-74 -501,-222 -102,268 -192,439 -270,513 -78,74 -206,111 -384,111l-182 0 0 -167 85 0c172,0 290,-35 355,-105 64,-69 147,-251 247,-546 -45,-79 -75,-146 -89,-199 -14,-53 -32,-169 -54,-349l-51 -384c-33,-253 -72,-427 -117,-522 -114,135 -213,318 -296,549 -84,231 -125,437 -125,619l0 108 -200 0zm1126 202c145,161 293,242 441,242 100,0 184,-35 251,-105 67,-69 100,-157 100,-261 0,-93 -32,-173 -96,-239 -63,-65 -141,-98 -232,-98 -197,0 -352,154 -464,461z" />
+   </g>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Gemini.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="183pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg620"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\gemini.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs621"><style
+   type="text/css"
+   id="style622"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(5.152124,0,0,5.157475,-9408.358,-14342.93)"><path
+   class="fil0"
+   d="M1524 5048l0 -167c186,-49 359,-84 518,-103l0 -1730c-172,-16 -345,-49 -518,-99l0 -168c300,83 668,125 1104,125 437,0 805,-42 1105,-125l0 168c-174,50 -347,83 -519,99l0 1730c159,19 332,54 519,103l0 167c-342,-90 -710,-134 -1105,-134 -395,0 -763,44 -1104,134zm719 -282c115,-13 243,-19 385,-19 142,0 270,6 385,19l0 -1704c-104,7 -232,11 -385,11 -154,0 -282,-4 -385,-11l0 1704z"
+   id="path624" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Leo.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="147pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg632"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\leo.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs633"><style
+   type="text/css"
+   id="style634"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(4.260087,0,0,4.260933,-12024.51,-18381.66)"><path
+   class="fil0"
+   d="M4866 6842c-157,144 -307,216 -451,216 -124,0 -229,-41 -314,-124 -84,-83 -126,-185 -126,-306 0,-162 85,-423 255,-784l130 -277c100,-214 150,-388 150,-521 0,-170 -49,-306 -148,-409 -99,-104 -230,-155 -393,-155 -153,0 -276,46 -371,137 -94,93 -141,213 -141,362 0,138 44,299 132,483l53 110c88,182 132,315 132,402 0,137 -53,258 -157,360 -104,102 -228,153 -370,153 -146,0 -271,-51 -373,-154 -103,-103 -154,-228 -154,-376 0,-142 50,-265 152,-368 101,-103 222,-155 362,-155 51,0 107,9 168,28 -97,-187 -146,-352 -146,-496 0,-187 67,-343 202,-467 136,-125 306,-187 510,-187 224,0 404,66 540,197 135,132 203,307 203,525 0,108 -11,202 -34,280 -22,79 -76,209 -160,390l-93 203c-166,360 -250,592 -250,698 0,78 23,142 70,192 46,51 106,76 178,76 95,0 204,-54 326,-162l118 129zm-1996 -881c0,106 36,196 107,269 71,72 158,109 262,109 102,0 188,-37 260,-110 72,-73 108,-162 108,-266 0,-106 -36,-195 -107,-268 -72,-72 -159,-109 -263,-109 -102,0 -188,37 -260,110 -71,73 -107,161 -107,265z"
+   id="path636" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Libra.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="225pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg644"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\libra.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs645"><style
+   type="text/css"
+   id="style646"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(6.484284,0,0,6.473976,-20499.79,-29016.36)"><path
+   class="fil0"
+   d="M2720 6288l0 -200 2158 0 0 200 -2158 0zm853 -789l0 187 -853 0 0 -201 598 0c-109,-111 -163,-236 -163,-374 0,-172 64,-319 191,-443 127,-124 278,-186 454,-186 175,0 326,62 453,186 128,124 191,271 191,443 0,138 -54,263 -163,374l597 0 0 201 -853 0 0 -187c145,-94 218,-220 218,-378 0,-120 -44,-222 -131,-308 -88,-87 -192,-130 -312,-130 -122,0 -226,43 -313,130 -87,86 -131,188 -131,308 0,158 72,284 217,378z"
+   id="path648" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Pisces.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="151.5pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg674"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\pisces.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs675"><style
+   type="text/css"
+   id="style676"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(5.548888,0,0,5.549122,-15669.98,-24593.71)"><path
+   class="fil0"
+   d="M3362 5518c0,165 -39,340 -115,524 -77,184 -179,350 -308,497l-219 0c295,-311 442,-651 442,-1021l-427 0 0 -150 427 0c-18,-322 -165,-634 -442,-936l207 0c254,271 399,583 435,936l414 0c37,-353 182,-665 435,-936l207 0c-277,302 -424,614 -442,936l427 0 0 150 -427 0c0,370 147,710 442,1021l-218 0c-130,-147 -232,-313 -309,-497 -76,-184 -115,-359 -115,-524l-414 0z"
+   id="path678" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Sagittarius.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="188pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg656"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\sagittarius.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs657"><style
+   type="text/css"
+   id="style658"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(5.538608,0,0,5.549122,-16777.01,-24593.71)"><path
+   class="fil0"
+   d="M4692 4570l139 989 -198 31 -102 -721 -905 907 426 425 -142 142 -426 -426 -626 622 -138 -138 625 -623 -425 -426 140 -142 426 426 907 -905 -721 -101 31 -198 989 138z"
+   id="path660" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Scorpio.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="171pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg650"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\scorpio.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs651"><style
+   type="text/css"
+   id="style652"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(4.472138,0,0,4.481411,-13347.59,-19910.91)"><path
+   class="fil0"
+   d="M2889 6489l0 -1432c0,-238 -56,-431 -169,-575l216 0c76,116 127,247 154,395 64,-158 143,-289 236,-395l194 -39c91,106 148,258 173,455 49,-141 130,-280 242,-416l198 -39c108,146 162,319 162,519l0 1250c0,131 5,220 13,266 10,47 30,87 62,122 57,60 153,90 287,90l123 0 0 -201 318 287 -318 276 0 -195 -184 0c-176,0 -303,-46 -382,-138 -80,-93 -120,-240 -120,-443l0 -1209c0,-204 -29,-350 -88,-439 -150,173 -255,389 -313,649l0 1212 -201 0 0 -1351c0,-243 -29,-413 -88,-510 -144,162 -248,364 -314,604l0 1257 -201 0z"
+   id="path654" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Taurus.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="180pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg614"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\taurus.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs615"><style
+   type="text/css"
+   id="style616"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(4.552447,0,0,4.540583,-8401.163,-13199.48)"><path
+   class="fil0"
+   d="M2373 3861c-89,-35 -160,-80 -216,-134 -55,-54 -116,-141 -183,-262l-80 -144c-98,-176 -210,-264 -334,-264l-36 0 0 -150 99 0c176,0 336,124 479,371l109 192c74,126 150,214 230,264 80,51 184,76 313,76 129,0 233,-25 313,-76 80,-50 156,-138 229,-264l111 -192c142,-247 302,-371 477,-371l99 0 0 150 -35 0c-125,0 -237,88 -335,264l-80 144c-67,121 -128,208 -183,262 -56,54 -128,99 -216,134 154,85 272,195 356,328 84,133 125,280 125,438 0,230 -85,430 -256,600 -172,170 -373,255 -605,255 -232,0 -433,-85 -605,-255 -172,-170 -258,-370 -258,-600 0,-158 42,-305 126,-438 84,-133 202,-243 356,-328zm381 1420c182,0 337,-63 467,-191 129,-126 194,-279 194,-458 0,-182 -65,-337 -193,-464 -128,-128 -284,-191 -468,-191 -183,0 -339,63 -469,191 -128,127 -193,282 -193,464 0,179 65,332 194,458 129,128 285,191 468,191z"
+   id="path618" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/images/Virgo.svg	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:odm="http://product.corel.com/CGS/11/cddns/"
+   xml:space="preserve"
+   width="155pt"
+   height="188pt"
+   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd"
+   viewBox="0 0 8268 11692"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg638"
+   sodipodi:version="0.34"
+   sodipodi:docname="D:\Dokumenty\Wikipedie\images\svg\Astro\virgo.svg"><sodipodi:namedview
+   id="base" /><defs
+   id="defs639"><style
+   type="text/css"
+   id="style640"><![CDATA[
+    .fil0 {fill:#000000}
+   ]]></style></defs><g
+   id="Layer 1"
+   transform="matrix(4.538455,0,0,4.531784,-13030.44,-20143.78)"><path
+   class="fil0"
+   d="M3086 5231l0 1258 -201 0 0 -1457c0,-202 -55,-386 -165,-550l212 0c75,103 126,236 154,397 68,-167 147,-299 236,-397l197 -37c90,116 147,270 171,462 46,-145 128,-287 245,-425l194 -37c109,151 163,318 163,501l0 382c54,-153 112,-274 172,-360l166 -61c143,221 214,454 214,698 0,194 -43,375 -128,545 -85,170 -214,328 -384,475 16,118 85,251 207,400l-236 0c-57,-72 -108,-168 -152,-287 -125,71 -279,121 -461,150l0 -172c172,-35 312,-86 422,-151 -14,-87 -21,-174 -21,-262l0 -1220c0,-199 -28,-349 -86,-451 -142,153 -247,369 -315,646l0 1211 -202 0 0 -1338c0,-249 -30,-422 -88,-519 -139,162 -243,361 -314,599zm1206 1206c118,-120 205,-248 264,-385 58,-137 87,-283 87,-436 0,-161 -35,-317 -105,-468 -100,123 -181,287 -246,492l0 797z"
+   id="path642" /></g></svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/listElements.pro	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,40 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-08-30T10:49:36
+#
+#-------------------------------------------------
+
+QT       += core gui svg
+
+TARGET = test242
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+    zodiacsign.cpp \
+    mainwindow.cpp \
+    zodiacmodel.cpp \
+    zodiacdelegate.cpp
+
+
+HEADERS  += mainwindow.h \
+    zodiacsign.h \
+    zodiacmodel.h \
+    zodiacdelegate.h
+
+FORMS    += mainwindow.ui
+
+CONFIG += mobility
+MOBILITY = 
+
+symbian {
+    TARGET.UID3 = 0xe5e9fbec
+    # TARGET.CAPABILITY += 
+    TARGET.EPOCSTACKSIZE = 0x14000
+    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+}
+
+RESOURCES += \
+    assets.qrc
+
+include(../modeltest-0.2/modeltest.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/main.cpp	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,16 @@
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.setWindowTitle("Zodiac");
+#if defined(Q_WS_S60)
+    w.showMaximized();
+#else
+    w.show();
+#endif
+
+    return a.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/mainwindow.cpp	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,27 @@
+#include <QMenuBar>
+
+#include <modeltest.h>
+
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include "zodiacmodel.h"
+#include "zodiacdelegate.h"
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+//    int heightMain = this->height();
+//    int heightBar = menuBar()->height();
+    ZodiacModel *zModel = new ZodiacModel(this);
+//  ModelTest *m = new ModelTest(zModel, this);
+    ui->listView->setModel(zModel);
+    ZodiacDelegate *delegate = new ZodiacDelegate(this);
+    ui->listView->setItemDelegate(delegate);
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/mainwindow.h	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,24 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+#include "zodiacsign.h"
+
+namespace Ui {
+    class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+private:
+    Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/mainwindow.ui	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>360</width>
+    <height>640</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <widget class="QFrame" name="frame">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>361</width>
+      <height>411</height>
+     </rect>
+    </property>
+    <property name="frameShape">
+     <enum>QFrame::Panel</enum>
+    </property>
+    <property name="frameShadow">
+     <enum>QFrame::Raised</enum>
+    </property>
+    <property name="lineWidth">
+     <number>4</number>
+    </property>
+    <widget class="QListView" name="listView">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>10</y>
+       <width>341</width>
+       <height>391</height>
+      </rect>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>14</pointsize>
+      </font>
+     </property>
+    </widget>
+   </widget>
+  </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/zodiacdelegate.cpp	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,41 @@
+#include <QFile>
+#include <QSvgRenderer>
+
+
+#include "zodiacdelegate.h"
+
+void ZodiacDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
+           const QModelIndex &index) const
+{
+    painter->save();
+    painter->setPen(Qt::red);
+    painter->setBrush(Qt::yellow);
+    painter->setRenderHints(QPainter::Antialiasing|QPainter::TextAntialiasing);
+
+    if (option.state & QStyle::State_Selected) {
+        painter->fillRect(option.rect, option.palette.highlight());
+    }
+
+    // draw the svg image.
+    int xOffset = 10;
+    int yOffset = 5;
+    int height = 15;
+    int width = 15;
+    QRectF imgRect(option.rect.x()+xOffset,option.rect.y()+yOffset,width,height);
+    QString svgFile(index.model()->data(index,Qt::DecorationRole).toString());
+    QSvgRenderer renderer(svgFile);
+    renderer.render(painter,imgRect);
+
+    // write the name
+    int xOffsetText = 55;
+    QRect rect(option.rect.x()+xOffsetText,option.rect.y(),option.rect.width(), option.rect.height());
+    painter->drawText(rect,Qt::AlignVCenter,
+                       index.model()->data(index,Qt::DisplayRole).toString());
+
+    // just for debugging
+    QPoint point(option.rect.x()+xOffsetText,option.rect.y());
+    painter->drawLine(point+QPoint(-5,0),point+QPoint(5,0));
+    painter->drawLine(point+QPoint(0,-5),point+QPoint(0,5));
+
+    painter->restore();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/zodiacdelegate.h	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,21 @@
+#ifndef ZODIACDELEGATE_H
+#define ZODIACDELEGATE_H
+
+#include <QModelIndex>
+#include <QPainter>
+#include <QStyledItemDelegate>
+#include <QStyleOptionViewItem>
+
+
+class ZodiacDelegate : public QStyledItemDelegate
+{
+    Q_OBJECT
+public:
+    explicit ZodiacDelegate(QObject *parent=0):QStyledItemDelegate(parent) {}
+
+    void paint(QPainter *painter, const QStyleOptionViewItem &option,
+               const QModelIndex &index) const;
+
+};
+
+#endif // ZODIACDELEGATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/zodiacmodel.cpp	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,131 @@
+#include <QBrush>
+#include <QColor>
+#include <QLinearGradient>
+#include <QIcon>
+#include <QSvgWidget>
+
+#include "zodiacmodel.h"
+#include "zodiacsign.h"
+
+ZodiacModel::ZodiacModel(QObject *parent) :
+    QAbstractListModel(parent)
+{
+    // color names must match SVG standard names http://www.w3.org/TR/SVG/types.html#ColorKeywords
+    this->signs.push_front( new ZodiacSign("Aries",
+                                 ":/images/Aries.svg",
+                                 QColor("red"),
+                                 QDate(2010,3,20),
+                                 QDate(2010,4,20)));
+
+    this->signs.push_front( new ZodiacSign("Taurus",
+                                 ":/images/Taurus.svg",
+                                 QColor("green"),
+                                 QDate(2010,4,20),
+                                 QDate(2010,5,21)));
+
+    this->signs.push_front( new ZodiacSign("Gemini",
+                                 ":/images/Gemini.svg",
+                                 QColor("orange"),
+                                 QDate(2010,5,21),
+                                 QDate(2010,6,21)));
+    this->signs.push_front( new ZodiacSign("Cancer",
+                                 ":/images/Cancer.svg",
+                                 QColor("violet"),
+                                 QDate(2010,6,21),
+                                 QDate(2010,7,22)));
+    this->signs.push_front( new ZodiacSign("Leo",
+                                 ":/images/Leo.svg",
+                                 QColor("yellow"),
+                                 QDate(2010,7,22),
+                                 QDate(2010,8,23)));
+    this->signs.push_front( new ZodiacSign("Virgo",
+                                 ":/images/Virgo.svg",
+                                 QColor("white"),
+                                 QDate(2010,8,23),
+                                 QDate(2010,9,23)));
+
+    this->signs.push_front( new ZodiacSign("Libra",
+                                 ":/images/Libra.svg",
+                                 QColor("green"),
+                                 QDate(2010,9,23),
+                                 QDate(2010,10,23)));
+
+    this->signs.push_front( new ZodiacSign("Scorpio",
+                                 ":/images/Scorpio.svg",
+                                 QColor("maroon"),
+                                 QDate(2010,10,23),
+                                 QDate(2010,11,22)));
+    this->signs.push_front( new ZodiacSign("Sagittarius",
+                                 ":/images/Sagittarius.svg",
+                                 QColor("blue"),
+                                 QDate(2010,11,22),
+                                 QDate(2010,12,22)));
+    this->signs.push_front( new ZodiacSign("Capricorn",
+                                 ":/images/Capricorn.svg",
+                                 QColor("indigo"),
+                                 QDate(2010,12,22),
+                                 QDate(2010,1,20)));
+    this->signs.push_front( new ZodiacSign("Aquarius",
+                                 ":/images/Aquarius.svg",
+                                 QColor("violet"),
+                                 QDate(2010,1,20),
+                                 QDate(2010,2,18)));
+    this->signs.push_front( new ZodiacSign("Pisces",
+                                 ":/images/Pisces.svg",
+                                 QColor("indigo"),
+                                 QDate(2010,1,20),
+                                 QDate(2010,2,18)));
+
+}
+
+int ZodiacModel::rowCount (const QModelIndex &index) const
+{
+    return this->signs.count();
+}
+
+QVariant ZodiacModel::data(const QModelIndex &index, int role)const
+{
+    QVariant rc;
+
+    if (!index.isValid() || index.row() >= this->signs.size()) {
+         return rc;
+    }
+    switch (role)
+    {
+    case Qt::DisplayRole:
+    {
+        rc = QVariant(this->signs.at(index.row())->getName());
+        break;
+    }
+    case Qt::BackgroundRole:
+    {
+        // a QBrush consists of a style, color, gradient and texture.
+        rc = QVariant(QBrush(this->signs.at(index.row())->getColor()));
+        // TODO: Doesn't the gradient require a rectangle and the Model shouldn't know
+        // anything about the UI. Strange.
+//        QLinearGradient gradient;
+//        gradient.setColorAt(0, QColor(0,136,181));
+//        gradient.setColorAt(0.2, QColor(181,231,247));
+//        gradient.setColorAt(1, QColor(0,136,181));
+
+        break;
+    }
+    case Qt::TextColorRole:
+    {
+        QString name = this->signs.at(index.row())->getName();
+        if (name == "Leo" || name == "Virgo")
+        {
+            // white text on a white or yellow background doesn't work. Let's change it.
+            rc = QVariant(QColor("silver"));
+        }
+        break;
+    }
+    case Qt::DecorationRole:
+    {
+        rc = QVariant(this->signs.at(index.row())->getImage());
+    }
+    default:
+        break;
+    }
+    return rc;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/zodiacmodel.h	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,25 @@
+#ifndef ZODIACMODEL_H
+#define ZODIACMODEL_H
+
+#include <QObject>
+#include <QAbstractListModel>
+
+#include "zodiacsign.h"
+
+class ZodiacModel : public QAbstractListModel
+{
+    Q_OBJECT
+public:
+    explicit ZodiacModel(QObject *parent = 0);
+
+    int rowCount (const QModelIndex &index = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role)const;
+signals:
+
+public slots:
+
+private:
+    QList <ZodiacSign*> signs;
+};
+
+#endif // ZODIACMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/zodiacsign.cpp	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,16 @@
+#include "zodiacsign.h"
+
+
+
+ZodiacSign::ZodiacSign(QString aName,
+           QString aUrl,
+           QColor aColor,
+           QDate aStart,
+           QDate aEnd): name(aName),
+                        image(aUrl),
+                        color(aColor),
+                        start(aStart),
+                        end(aEnd)
+{
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ListElements/ModelViewList/zodiacsign.h	Fri Sep 03 10:38:13 2010 -0700
@@ -0,0 +1,32 @@
+#ifndef ZODIACSIGN_H
+#define ZODIACSIGN_H
+
+#include <QColor>
+#include <QDate>
+#include <QString>
+
+
+class ZodiacSign : public QObject
+{
+    Q_OBJECT
+public:
+    explicit ZodiacSign(QString name,
+               QString sign,
+               QColor color,
+               QDate start,
+               QDate end);
+    QString getName() { return name;}
+    QString getImage() { return image; }
+    QColor getColor() {return color; }
+    QDate getStart() {return start; }
+    QDate getEnd() {return end; }
+
+private:
+      QString name;
+      QString image;
+      QColor color;
+      QDate start;
+      QDate end;
+};
+
+#endif // ZODIACSIGN_H