コード例 #1
0
ファイル: widget.cpp プロジェクト: lxgsbqylbk/Qt_Calendar
void Widget::SetConnect()
{
    //每秒显示时间
    connect(m_timer,SIGNAL(timeout()),this,SLOT(SetCurrentTime()));
    //返回今天
    connect(m_TotodayButton,SIGNAL(clicked()),this,SLOT(ReturnToday()));

    connect(m_Calendar,SIGNAL(selectionChanged()),this,SLOT(DateChanged()));
    connect(m_NextDayButton,SIGNAL(clicked()),this,SLOT(ToNextDay()));
    connect(m_ToPreDayButton,SIGNAL(clicked()),this,SLOT(ToPreDay()));

    connect(m_YearComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(ToCertainDate()));
    connect(m_MonthComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(ToCertainDate()));
    connect(m_DayComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(ToCertainDate()));
    connect(m_YearComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(SetCBDay()));
    connect(m_MonthComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(SetCBDay()));

    QTimer::singleShot(0,this,SLOT(SetCurrentTime()));
    QTimer::singleShot(0,this,SLOT(DateChanged()));
}
コード例 #2
0
ファイル: MonthView.cpp プロジェクト: NeerajDev/GrizzlyPeak
 //Slot that handles the date selection in the view.
 void MonthView::slot_dateSelected(int row, int column)
 {

        QTableWidgetItem *item = ui->tblDates->item(row,column);
        emit(DateChanged(QDate::fromString(item->whatsThis())));
 }