Advertisement

QT QDate获取 today, yesterday, tomorrow, this week, last week, this month, last month日期

阅读量:
复制代码
    void TOOLFUNCS::DateTime::on_Select_activated(const QString &arg1)
    {
    QDate date = QDate::currentDate();
    if(arg1 == m_codec->toUnicode("今天"))
    {
        ui->Date1->setDate(date);
        ui->Date2->setDate(date);
    }
    else if(arg1 == m_codec->toUnicode("明天"))
    {
        ui->Date1->setDate(date);
        ui->Date2->setDate(date.addDays(1));
    }
    else if(arg1 == m_codec->toUnicode("昨天"))
    {
        ui->Date1->setDate(date.addDays(-1));
        ui->Date2->setDate(date);
    }
    else if(arg1 == m_codec->toUnicode("最近三天"))
    {
        ui->Date1->setDate(dat

全部评论 (0)

还没有任何评论哟~