5 MyWidget::MyWidget(QWidget
*parent
)
8 m_ui
= new Ui::MyWidgetBase();
11 m_ui
->m_hslider
->setMinimum(1);
12 m_ui
->m_progress
->setMinimum(1);
14 connect(m_ui
->m_calendar
, SIGNAL(clicked(const QDate
&)), this,
15 SLOT(slot_clicked(const QDate
&)));
16 connect(m_ui
->m_hslider
, SIGNAL(valueChanged(int)), this,
17 SLOT(slot_changed(int)));
19 slot_clicked(QDate::currentDate());
26 void MyWidget::slot_clicked(const QDate
&date
)
29 m_ui
->m_hslider
->setMaximum(date
.daysInMonth());
30 m_ui
->m_hslider
->setValue(date
.day());
33 m_ui
->m_progress
->setMaximum(date
.daysInMonth());
34 m_ui
->m_progress
->setValue(date
.day());
37 m_ui
->m_label
->setText(date
.toString("dddd"));
40 void MyWidget::slot_changed(int value
)
44 date
= QDate::currentDate();
46 date
.setDate(date
.year(), date
.month(), value
);
47 m_ui
->m_calendar
->setSelectedDate(date
);