void SelectDialog::createLayout(QWidget *parent)
{
listClub = new QListWidget(parent);
- lineEditDate = new QLineEdit;
pushButtonNext = new QPushButton(tr("Next"));
- QDate today(QDate::currentDate());
- lineEditDate->setText(today.toString("yyyy-MM-dd"));
- date = new QDateEdit;
-
connect(pushButtonNext, SIGNAL(clicked()), this, SLOT(next()));
leftLayout = new QVBoxLayout;
leftLayout->addWidget(listClub);
- //leftLayout->addWidget(date);
+
+#ifdef Q_WS_MAEMO_5
+ dateButton = new QMaemo5ValueButton();
+ dateButton->setValueLayout(QMaemo5ValueButton::ValueUnderText);
+ dateButton->setPickSelector(new QMaemo5DatePickSelector());
+ dateButton->setText(QString::fromUtf8("Date"));
+ leftLayout->addWidget(dateButton);
+#else
+ QDate today(QDate::currentDate());
+ lineEditDate = new QLineEdit;
+ lineEditDate->setText(today.toString("yyyy-MM-dd"));
+ date = new QDateEdit;
+ leftLayout->addWidget(date);
leftLayout->addWidget(lineEditDate);
+#endif
rightLayout = new QVBoxLayout;
rightLayout->addStretch();
QStringList stringList = tmp.split(",");
club = stringList[0];
course = stringList[1];
- date = lineEditDate->text();
+#ifdef Q_WS_MAEMO_5
+ QMaemo5DatePickSelector *sel = (QMaemo5DatePickSelector *)dateButton->pickSelector();
+ QDate d = sel->currentDate();
+ // TODO: change to QDate
+ date = d.toString(Qt::ISODate);
+#else
+ date = lineEditDate->text();
+#endif
}
}