a little clean up
authorJohn Kern <johnk@symbian.org>
Thu, 09 Sep 2010 14:29:26 -0700
changeset 46 702dd26c0f4d
parent 45 b23ec2b62c45
child 47 c6e75ec74fc8
a little clean up
ListElements/ModelViewList/listElements.pro
ListElements/ModelViewList/main.cpp
ListElements/ModelViewList/mainwindow.cpp
ListElements/ModelViewList/zodiacmodel.cpp
--- a/ListElements/ModelViewList/listElements.pro	Thu Sep 09 11:30:41 2010 -0700
+++ b/ListElements/ModelViewList/listElements.pro	Thu Sep 09 14:29:26 2010 -0700
@@ -6,7 +6,7 @@
 
 QT       += core gui svg
 
-TARGET = test242
+TARGET = listElements
 TEMPLATE = app
 
 
@@ -18,6 +18,8 @@
     PLLayout.cpp
 
 
+# DEFINES = USE_DELEGATE
+
 HEADERS  += mainwindow.h \
     zodiacsign.h \
     zodiacmodel.h \
--- a/ListElements/ModelViewList/main.cpp	Thu Sep 09 11:30:41 2010 -0700
+++ b/ListElements/ModelViewList/main.cpp	Thu Sep 09 14:29:26 2010 -0700
@@ -14,7 +14,6 @@
     MainWindow w;
     w.setWindowTitle("Zodiac");
 #if defined(Q_WS_S60)
-    // w.showMaximized();
     w.showFullScreen();
 #else
     w.show();
--- a/ListElements/ModelViewList/mainwindow.cpp	Thu Sep 09 11:30:41 2010 -0700
+++ b/ListElements/ModelViewList/mainwindow.cpp	Thu Sep 09 14:29:26 2010 -0700
@@ -21,20 +21,23 @@
     listView->setLineWidth(4);
     exitButton = new QPushButton(this);
     exitButton->setText("Exit");
+    connect(exitButton, SIGNAL(clicked()), this,SLOT(close()));
 
     // define the model
     ZodiacModel *zModel = new ZodiacModel(this);
     listView->setModel(zModel);
+#ifdef USE_DELEGATE
     ZodiacDelegate *delegate = new ZodiacDelegate(this);
     listView->setItemDelegate(delegate);
+#endif
 
     // create landscape layout
-    layoutLandscape = new QHBoxLayout(this);
+    layoutLandscape = new QHBoxLayout;
     layoutLandscape->addWidget(listView);
     layoutLandscape->addWidget(exitButton);
 
     //create portrait layout
-    layoutPortrait = new QVBoxLayout(this);
+    layoutPortrait = new QVBoxLayout;
     layoutPortrait->addWidget(listView);
     layoutPortrait->addWidget(exitButton);
 
--- a/ListElements/ModelViewList/zodiacmodel.cpp	Thu Sep 09 11:30:41 2010 -0700
+++ b/ListElements/ModelViewList/zodiacmodel.cpp	Thu Sep 09 14:29:26 2010 -0700
@@ -101,12 +101,6 @@
     {
         // 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;
     }