当前位置: 首页>>代码示例>>C++>>正文


C++ QDate::isNull方法代码示例

本文整理汇总了C++中QDate::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ QDate::isNull方法的具体用法?C++ QDate::isNull怎么用?C++ QDate::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDate的用法示例。


在下文中一共展示了QDate::isNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: query

QList<Message> HistorySqlStorage::sms(const QString &recipient, const QDate &date, int limit)
{
	kdebugf();

	DatabaseMutex.lock();

	QSqlQuery query(Database);
	QString queryString = "SELECT content, send_time FROM kadu_sms WHERE receipient = :receipient";
	if (!date.isNull())
		queryString += " AND date(send_time) = date(:date)";
	queryString += " ORDER BY send_time ASC";
	if (0 != limit)
		queryString += " LIMIT :limit";

	query.prepare(queryString);

	query.bindValue(":receipient", recipient);
	if (!date.isNull())
		query.bindValue(":date", date.toString(Qt::ISODate));
	if (limit != 0)
		query.bindValue(":limit", limit);
	executeQuery(query);

	QList<Message> result = smsFromQuery(query);

	DatabaseMutex.unlock();

	return result;
}
开发者ID:partition,项目名称:kadu,代码行数:29,代码来源:history-sql-storage.cpp

示例2: setDateRangeFilter

void MultipleFilterProxy::setDateRangeFilter(qint32 col, const QDate& minDate, const QDate& maxDate, qint32 role)
{
    if (col < 0 || col >= m_dateRangeFilter.size())
        return;
    if (minDate.isNull() && maxDate.isNull())
        return removeFilterFromColumn(col, role);
    m_regExpFilter[col].remove(role);
    m_boolFilter[col].remove(role);
    m_dateRangeFilter[col][role] = std::make_pair(minDate, maxDate);
    invalidateFilter();
}
开发者ID:VSRonin,项目名称:FXhelper,代码行数:11,代码来源:MultipleFilterProxy.cpp

示例3: DateRangeUpdated

void MainWindow::DateRangeUpdated(QDate s, QDate e)
{
    Range<QDate> r( m_sdr->GetDateRange() );

    lbl_dateStart->setText(QString("Start Date: %1").arg(r.LowerBound().Value().toString("ddd MMMM d yyyy")));
    lbl_dateEnd->setText(QString("End Date: %1").arg(r.UpperBound().Value().toString("ddd MMMM d yyyy")));
    lbl_updateCount->setText(QString("Update Count: %1").arg(++m_updateCount));

    GASSERT(s.isNull() || s == r.LowerBound().Value());
    GASSERT(e.isNull() || e == r.UpperBound().Value());
}
开发者ID:karagog,项目名称:gutil,代码行数:11,代码来源:mainwindow.cpp

示例4: QDateTimeToDATE

static DATE QDateTimeToDATE(const QDateTime &dt)
{
    if (!dt.isValid() || dt.isNull())
        return 949998;
    
    SYSTEMTIME stime;
    memset(&stime, 0, sizeof(stime));
    QDate date = dt.date();
    QTime time = dt.time();
    if (date.isValid() && !date.isNull()) {
        stime.wDay = date.day();
        stime.wMonth = date.month();
        stime.wYear = date.year();
    }
    if (time.isValid() && !time.isNull()) {
        stime.wMilliseconds = time.msec();
        stime.wSecond = time.second();
        stime.wMinute = time.minute();
        stime.wHour = time.hour();
    }
    
    double vtime;
    SystemTimeToVariantTime(&stime, &vtime);
    
    return vtime;
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:26,代码来源:qaxtypes.cpp

示例5: populate

void itemPricingSchedule::populate()
{
    XSqlQuery itempopulate;
    XSqlQuery pop;
    pop.prepare( "SELECT ipshead_name, ipshead_descrip,"
                 "       ipshead_effective, ipshead_expires, "
                 "       ipshead_curr_id, ipshead_updated "
                 "FROM ipshead "
                 "WHERE (ipshead_id=:ipshead_id);" );
    pop.bindValue(":ipshead_id", _ipsheadid);
    pop.exec();
    if (pop.first())
    {
        _name->setText(pop.value("ipshead_name").toString());
        _descrip->setText(pop.value("ipshead_descrip").toString());
        _dates->setStartDate(pop.value("ipshead_effective").toDate());
        _dates->setEndDate(pop.value("ipshead_expires").toDate());
        _currency->setId(pop.value("ipshead_curr_id").toInt());
        _currency->setEnabled(FALSE);
        QDate tmpDate = pop.value("ipshead_updated").toDate();
        if (tmpDate.isValid() && ! tmpDate.isNull())
            _updated = tmpDate;

        sFillList(-1);
    }
    else if (itempopulate.lastError().type() != QSqlError::NoError)
    {
        systemError(this, _rejectedMsg.arg(itempopulate.lastError().databaseText()),
                    __FILE__, __LINE__);
        reject();
    }
}
开发者ID:hescoinc,项目名称:qt-client,代码行数:32,代码来源:itemPricingSchedule.cpp

示例6: SetFlow

void GenericCashFlow::SetFlow(QDate Dte, double Amt, qint32 FlowTpe) {
    Q_D(GenericCashFlow);
	if (Dte.isNull()) return;
    if (d->m_AdjustHolidays) {
        while (IsHoliday(Dte)) 
            Dte = Dte.addDays(1);
    }
	if (qAbs(Amt) < 0.01) Amt = 0.0;
    auto index = d->m_CashFlows.begin();
    for (; index != d->m_CashFlows.end(); ++index) {
        if (d->SamePeriod(Dte, index.key(), d->m_AggregationLevel)) 
            break;
	}
    if (index != d->m_CashFlows.end()) {
		if (index.value()->contains(FlowTpe)) {
            if (Amt == 0.0 && !d->m_Stocks.contains(FlowTpe)) 
                index.value()->remove(FlowTpe);
			else
				index.value()->operator[](FlowTpe) = Amt;
		}
		else {
            if (qAbs(Amt) > 0.0 || d->m_Stocks.contains(FlowTpe)) {
				index.value()->insert(FlowTpe, Amt);
			}
		}
	}
	else {
        d->m_CashFlows.insert(Dte, std::make_shared<QHash<qint32, double> >());
        if (qAbs(Amt) > 0.0 || d->m_Stocks.contains(FlowTpe)) {
            d->m_CashFlows[Dte]->insert(FlowTpe, Amt);
		}
	}
}
开发者ID:VSRonin,项目名称:CLOModel,代码行数:33,代码来源:GenericCashFlow.cpp

示例7:

int CalendarBox::Context::daysShiftForMonth(QDate month) {
	Assert(!month.isNull());
	constexpr auto kMaxRows = 6;
	auto inMonthIndex = month.day() - 1;
	auto inWeekIndex = month.dayOfWeek() - 1;
	return ((kMaxRows * kDaysInWeek) + inWeekIndex - inMonthIndex) % kDaysInWeek;
}
开发者ID:Federated-Blockchains-Initiative,项目名称:tdesktop,代码行数:7,代码来源:calendar_box.cpp

示例8: isValid

bool KCalendarSystem::isValid( const QDate &date ) const
{
    if ( date.isNull() || date < earliestValidDate() || date > latestValidDate() ) {
        return false;
    }
    return true;
}
开发者ID:basilk87,项目名称:smc,代码行数:7,代码来源:kcalendarsystem.cpp

示例9: removeFile

	void LogTraceListener::removeFile(QDir& dir, const string& fileName, int days)
	{
		string name = fileName;
		if (strcmp(_fullFileName.c_str(), name.c_str()) != 0)
		{
			const QDateTime now = QDateTime::currentDateTime();

			if (!_prefix.empty())
			{
				Convert::replaceStr(name, _prefix, "");
			}
			if (!_suffix.empty())
			{
				Convert::replaceStr(name, _suffix, "");
			}
			Convert::replaceStr(name, ".log", "");
			QDate date = Convert::parseDate(name);
			int sec = now.secsTo(date);
			if (!date.isNull() && date.isValid() &&
				sec < 0 && (-sec > days * 24 * 3600))
			{
				bool result = dir.remove(fileName.c_str());
				if(result)
				{
					Trace::WriteFormatLine(Resources::RemoveLogFilesSuccessfullyStr, fileName.c_str());
				}
				else
				{
					Trace::WriteFormatLine(Resources::FailedtoRemoveLogFilesStr, fileName.c_str());
				}
			}
		}
	}
开发者ID:davidbao,项目名称:SmartTimer,代码行数:33,代码来源:LogTraceListener.cpp

示例10:

void
TenderAdjustment::setDate(QDate date)
{
    if (date.isNull())
	date = QDate::currentDate();
    _gltxFrame->date->setDate(date);
}
开发者ID:cwarden,项目名称:quasar,代码行数:7,代码来源:tender_adjustment.cpp

示例11: insertRangeAtDate

// insert a new range starting at the given date extending to the end of the zone currently
// containing that date.  If the start date of that zone is prior to the specified start
// date, then that zone range is shorted.
int Zones::insertRangeAtDate(QDate date, int cp) {
    assert(date.isValid());
    int rnum;

    if (ranges.empty()) {
	addZoneRange(cp);
	fprintf(
		stderr,
		"Generating first range with CP = %d\n",
		cp
		);
	rnum = 0;
    }
    
    else {
	rnum = whichRange(date);
	assert(rnum >= 0);
	QDate date1 = getStartDate(rnum);
	fprintf(stderr, "insertRangeAtDate(%s, %d):\n", date.toString().toAscii().constData(), cp);

	// if the old range has dates before the specified, then truncate the old range
	// and shift up the existing ranges
	if (date > date1) {
	    QDate endDate = getEndDate(rnum);
	    setEndDate(rnum, date);
	    fprintf(
		    stderr,
		    "Inserting range\n"
		    "old range %d: from %s to %s\n"
		    "new range %d: from %s to %s\n"
		    "added range %d: from %s to %s\n",
		    rnum + 1, getStartDateString(rnum).toAscii().constData(), getEndDateString(rnum).toAscii().constData(),
		    rnum + 1, getStartDateString(rnum).toAscii().constData(), (date.isNull() ? "END" : date.toString().toAscii().constData()), 
		    rnum + 2, (date.isNull() ? "BEGIN" : date.toString().toAscii().constData()), getEndDateString(rnum).toAscii().constData()
		    );
	    ranges.insert(++ rnum, new ZoneRange(date, endDate));
	}
    }

    if (cp > 0) {
	setCP(rnum, cp);
	setZonesFromCP(rnum);
    }

    return rnum;
}
开发者ID:mdherynk,项目名称:GoldenCheetah,代码行数:49,代码来源:Zones.cpp

示例12: locale

QString Settings::BirthdayPage::textForDate(const QDate& date) const
{
    if (date.isNull()) {
        return m_noDateString;
    } else {
        return KGlobal::locale()->formatDate(date, KLocale::ShortDate);
    }
}
开发者ID:astifter,项目名称:kphotoalbum-astifter-branch,代码行数:8,代码来源:BirthdayPage.cpp

示例13: daysShiftForMonth

int CalendarBox::Context::rowsCountForMonth(QDate month) {
	Assert(!month.isNull());
	auto daysShift = daysShiftForMonth(month);
	auto daysCount = month.daysInMonth();
	auto cellsCount = daysShift + daysCount;
	auto result = (cellsCount / kDaysInWeek);
	if (cellsCount % kDaysInWeek) ++result;
	return result;
}
开发者ID:Federated-Blockchains-Initiative,项目名称:tdesktop,代码行数:9,代码来源:calendar_box.cpp

示例14: clearChatHistory

void HistorySqlStorage::clearChatHistory(const Chat &chat, const QDate &date)
{
	DatabaseMutex.lock();

	QSqlQuery query(Database);
	QString queryString = "DELETE FROM kadu_messages WHERE " + chatWhere(chat);
	if (!date.isNull())
		queryString += " AND date(receive_time) = date(:date)";

	query.prepare(queryString);

	if (!date.isNull())
		query.bindValue(":date", date.toString(Qt::ISODate));

	executeQuery(query);

	DatabaseMutex.unlock();
}
开发者ID:partition,项目名称:kadu,代码行数:18,代码来源:history-sql-storage.cpp

示例15: clearStatusHistory

void HistorySqlStorage::clearStatusHistory(const Buddy &buddy, const QDate &date)
{
	DatabaseMutex.lock();

	QSqlQuery query(Database);
	QString queryString = "DELETE FROM kadu_statuses WHERE " + buddyContactsWhere(buddy);
	if (!date.isNull())
		queryString += " AND date(set_time) = date(:date)";

	query.prepare(queryString);

	if (!date.isNull())
		query.bindValue(":date", date.toString(Qt::ISODate));

	executeQuery(query);

	DatabaseMutex.unlock();
}
开发者ID:partition,项目名称:kadu,代码行数:18,代码来源:history-sql-storage.cpp


注:本文中的QDate::isNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。