| 312 | } |
| 313 | |
| 314 | void Window::createDatesGroupBox() |
| 315 | { |
| 316 | datesGroupBox = new QGroupBox(tr("Dates")); |
| 317 | |
| 318 | minimumDateEdit = new QDateEdit; |
| 319 | minimumDateEdit->setDisplayFormat("MMM d yyyy"); |
| 320 | minimumDateEdit->setDateRange(calendar->minimumDate(), |
| 321 | calendar->maximumDate()); |
| 322 | minimumDateEdit->setDate(calendar->minimumDate()); |
| 323 | |
| 324 | minimumDateLabel = new QLabel(tr("&Minimum Date:")); |
| 325 | minimumDateLabel->setBuddy(minimumDateEdit); |
| 326 | |
| 327 | currentDateEdit = new QDateEdit; |
| 328 | currentDateEdit->setDisplayFormat("MMM d yyyy"); |
| 329 | currentDateEdit->setDate(calendar->selectedDate()); |
| 330 | currentDateEdit->setDateRange(calendar->minimumDate(), |
| 331 | calendar->maximumDate()); |
| 332 | |
| 333 | currentDateLabel = new QLabel(tr("&Current Date:")); |
| 334 | currentDateLabel->setBuddy(currentDateEdit); |
| 335 | |
| 336 | maximumDateEdit = new QDateEdit; |
| 337 | maximumDateEdit->setDisplayFormat("MMM d yyyy"); |
| 338 | maximumDateEdit->setDateRange(calendar->minimumDate(), |
| 339 | calendar->maximumDate()); |
| 340 | maximumDateEdit->setDate(calendar->maximumDate()); |
| 341 | |
| 342 | maximumDateLabel = new QLabel(tr("Ma&ximum Date:")); |
| 343 | maximumDateLabel->setBuddy(maximumDateEdit); |
| 344 | |
| 345 | connect(currentDateEdit, SIGNAL(dateChanged(QDate)), calendar, |
| 346 | SLOT(setSelectedDate(QDate))); |
| 347 | connect(calendar, SIGNAL(selectionChanged()), this, |
| 348 | SLOT(selectedDateChanged())); |
| 349 | connect(minimumDateEdit, SIGNAL(dateChanged(QDate)), this, |
| 350 | SLOT(minimumDateChanged(QDate))); |
| 351 | connect(maximumDateEdit, SIGNAL(dateChanged(QDate)), this, |
| 352 | SLOT(maximumDateChanged(QDate))); |
| 353 | |
| 354 | QGridLayout* dateBoxLayout = new QGridLayout; |
| 355 | dateBoxLayout->addWidget(currentDateLabel, 1, 0); |
| 356 | dateBoxLayout->addWidget(currentDateEdit, 1, 1); |
| 357 | dateBoxLayout->addWidget(minimumDateLabel, 0, 0); |
| 358 | dateBoxLayout->addWidget(minimumDateEdit, 0, 1); |
| 359 | dateBoxLayout->addWidget(maximumDateLabel, 2, 0); |
| 360 | dateBoxLayout->addWidget(maximumDateEdit, 2, 1); |
| 361 | dateBoxLayout->setRowStretch(3, 1); |
| 362 | |
| 363 | datesGroupBox->setLayout(dateBoxLayout); |
| 364 | } |
| 365 | |
| 366 | void Window::createTextFormatsGroupBox() |
| 367 | { |