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


C++ KDateTime::setTime_t方法代码示例

本文整理汇总了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;
}
开发者ID:chusopr,项目名称:kdepim-ktimetracker-akonadi,代码行数:13,代码来源:maillistdrag.cpp

示例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]);
}
开发者ID:chusopr,项目名称:kdepim-ktimetracker-akonadi,代码行数:16,代码来源:knfolder.cpp

示例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);
		}
开发者ID:KDE,项目名称:cocoon,代码行数:17,代码来源:CommitPopulationTest.cpp

示例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
}
开发者ID:w5292c,项目名称:test,代码行数:18,代码来源:another.cpp

示例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);
}
开发者ID:KDE,项目名称:libkfbapi,代码行数:18,代码来源:allnoteslistjob.cpp


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