examples/widgets/calendarwidget/window.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   194     calendar = new QCalendarWidget;
   194     calendar = new QCalendarWidget;
   195     calendar->setMinimumDate(QDate(1900, 1, 1));
   195     calendar->setMinimumDate(QDate(1900, 1, 1));
   196     calendar->setMaximumDate(QDate(3000, 1, 1));
   196     calendar->setMaximumDate(QDate(3000, 1, 1));
   197     calendar->setGridVisible(true);
   197     calendar->setGridVisible(true);
   198 
   198 
   199     connect(calendar, SIGNAL(currentPageChanged(int, int)),
   199     connect(calendar, SIGNAL(currentPageChanged(int,int)),
   200             this, SLOT(reformatCalendarPage()));
   200             this, SLOT(reformatCalendarPage()));
   201 
   201 
   202     previewLayout = new QGridLayout;
   202     previewLayout = new QGridLayout;
   203     previewLayout->addWidget(calendar, 0, 0, Qt::AlignCenter);
   203     previewLayout->addWidget(calendar, 0, 0, Qt::AlignCenter);
   204     previewGroupBox->setLayout(previewLayout);
   204     previewGroupBox->setLayout(previewLayout);
   355 
   355 
   356     maximumDateLabel = new QLabel(tr("Ma&ximum Date:"));
   356     maximumDateLabel = new QLabel(tr("Ma&ximum Date:"));
   357     maximumDateLabel->setBuddy(maximumDateEdit);
   357     maximumDateLabel->setBuddy(maximumDateEdit);
   358 
   358 
   359 //! [13] //! [14]
   359 //! [13] //! [14]
   360     connect(currentDateEdit, SIGNAL(dateChanged(const QDate &)),
   360     connect(currentDateEdit, SIGNAL(dateChanged(QDate)),
   361             calendar, SLOT(setSelectedDate(const QDate &)));
   361             calendar, SLOT(setSelectedDate(QDate)));
   362     connect(calendar, SIGNAL(selectionChanged()),
   362     connect(calendar, SIGNAL(selectionChanged()),
   363             this, SLOT(selectedDateChanged()));
   363             this, SLOT(selectedDateChanged()));
   364     connect(minimumDateEdit, SIGNAL(dateChanged(const QDate &)),
   364     connect(minimumDateEdit, SIGNAL(dateChanged(QDate)),
   365             this, SLOT(minimumDateChanged(const QDate &)));
   365             this, SLOT(minimumDateChanged(QDate)));
   366     connect(maximumDateEdit, SIGNAL(dateChanged(const QDate &)),
   366     connect(maximumDateEdit, SIGNAL(dateChanged(QDate)),
   367             this, SLOT(maximumDateChanged(const QDate &)));
   367             this, SLOT(maximumDateChanged(QDate)));
   368 
   368 
   369 //! [14]
   369 //! [14]
   370     QGridLayout *dateBoxLayout = new QGridLayout;
   370     QGridLayout *dateBoxLayout = new QGridLayout;
   371     dateBoxLayout->addWidget(currentDateLabel, 1, 0);
   371     dateBoxLayout->addWidget(currentDateLabel, 1, 0);
   372     dateBoxLayout->addWidget(currentDateEdit, 1, 1);
   372     dateBoxLayout->addWidget(currentDateEdit, 1, 1);
   416 //! [17] //! [18]
   416 //! [17] //! [18]
   417     connect(weekdayColorCombo, SIGNAL(currentIndexChanged(int)),
   417     connect(weekdayColorCombo, SIGNAL(currentIndexChanged(int)),
   418             this, SLOT(weekdayFormatChanged()));
   418             this, SLOT(weekdayFormatChanged()));
   419     connect(weekendColorCombo, SIGNAL(currentIndexChanged(int)),
   419     connect(weekendColorCombo, SIGNAL(currentIndexChanged(int)),
   420             this, SLOT(weekendFormatChanged()));
   420             this, SLOT(weekendFormatChanged()));
   421     connect(headerTextFormatCombo, SIGNAL(currentIndexChanged(const QString &)),
   421     connect(headerTextFormatCombo, SIGNAL(currentIndexChanged(QString)),
   422             this, SLOT(reformatHeaders()));
   422             this, SLOT(reformatHeaders()));
   423     connect(firstFridayCheckBox, SIGNAL(toggled(bool)),
   423     connect(firstFridayCheckBox, SIGNAL(toggled(bool)),
   424             this, SLOT(reformatCalendarPage()));
   424             this, SLOT(reformatCalendarPage()));
   425     connect(mayFirstCheckBox, SIGNAL(toggled(bool)),
   425     connect(mayFirstCheckBox, SIGNAL(toggled(bool)),
   426             this, SLOT(reformatCalendarPage()));
   426             this, SLOT(reformatCalendarPage()));