# HG changeset patch # User John Kern # Date 1284067766 25200 # Node ID 702dd26c0f4d0aa8c43c20b150754357484a64c3 # Parent b23ec2b62c4555251a960aef9f587e678bcf97fd a little clean up diff -r b23ec2b62c45 -r 702dd26c0f4d ListElements/ModelViewList/listElements.pro --- 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 \ diff -r b23ec2b62c45 -r 702dd26c0f4d ListElements/ModelViewList/main.cpp --- 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(); diff -r b23ec2b62c45 -r 702dd26c0f4d ListElements/ModelViewList/mainwindow.cpp --- 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); diff -r b23ec2b62c45 -r 702dd26c0f4d ListElements/ModelViewList/zodiacmodel.cpp --- 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; }