本文整理汇总了C++中KDateTime::setTime_t方法的典型用法代码示例。如果您正苦于以下问题:C++ KDateTime::setTime_t方法的具体用法?C++ KDateTime::setTime_t怎么用?C++ KDateTime::setTime_t使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDateTime
的用法示例。
在下文中一共展示了KDateTime::setTime_t方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Have to define before use
QDataStream& operator<< ( QDataStream &s, const MailSummary &d )
{
s << d.serialNumber();
s << d.messageId();
s << d.subject();
s << d.from();
s << d.to();
KDateTime tempTime;
tempTime.setTime_t( d.date() );
s << tempTime.dateTime();
return s;
}
示例2:
void KNFolder::DynData::getData( KNLocalArticle::Ptr a )
{
a->setId(id);
KDateTime dt;
dt.setTime_t( ti );
a->date()->setDateTime( dt );
a->setStartOffset(so);
a->setEndOffset(eo);
a->setServerId(sId);
a->setDoMail(flags[0]);
a->setMailed(flags[1]);
a->setDoPost(flags[2]);
a->setPosted(flags[3]);
a->setCanceled(flags[4]);
a->setEditDisabled(flags[5]);
}
示例3: shouldPopulateCommittedAtCorrectly
void shouldPopulateCommittedAtCorrectly() {
QStringList rawData;
rawData << "tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904";
rawData << "parent abffc0ae9ba476fe1e9a30fa2c8903113dbadb3d";
rawData << "author Me 1234567890 -0230";
rawData << "committer You 1234567890 -0230";
rawData << "";
rawData << "Some message.";
rawData << "";
commit->fillFromString(rawData.join("\n"));
KDateTime committedAt;
committedAt.setTime_t(1234567890);
committedAt.setTimeSpec(KDateTime::Spec(KDateTime::OffsetFromUTC, -9000/*==2,5h*/));
QCOMPARE(commit->committedAt().toString(), committedAt.toString());
QCOMPARE(commit->committedAt().utcOffset(), -9000);
}
示例4: test
void test()
{
KDateTime time;
time.setTime_t(12345678);
qDebug() << "Type:" << time.timeType();
QList<QVariant> list;
list << 123ULL << "Hello";
qDebug() << "List:" << list;
#if 0
QMessageLogContext context;
context.function = "void AClass::hello(void)";
context.file = "../src/another.cpp";
context.category = "[EAS]";
context.line = __LINE__;
// qDebug() << qCleanupFuncinfo("void hello(void)");
qDebug() << qMessageFormatString(QtDebugMsg, context, "This is a debug string");
#endif
}
示例5: shouldStartNewJob
bool AllNotesListJob::shouldStartNewJob(const KUrl &prev, const KUrl &next)
{
Q_UNUSED(next);
Q_D(AllNotesListJob);
const QString since = prev.queryItem("since");
if (since.isEmpty()) {
kDebug() << "Aborting notes fetching, no date range found in URL!";
return false;
}
KDateTime sinceTime;
sinceTime.setTime_t(since.toLongLong());
if (!sinceTime.isValid()) {
kDebug() << "Aborting notes fetching, invalid date range found in URL!";
return false;
}
return (sinceTime >= d->lowerLimit);
}