本文整理汇总了C++中QDate::dayName方法的典型用法代码示例。如果您正苦于以下问题:C++ QDate::dayName方法的具体用法?C++ QDate::dayName怎么用?C++ QDate::dayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDate
的用法示例。
在下文中一共展示了QDate::dayName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void SpawnPointListItem::update()
{
QString tmpStr;
// set the coordinate information
if (showeq_params->retarded_coords)
{
setText(tSpawnPointCoord1, QString::number(m_spawnPoint->y()));
setText(tSpawnPointCoord2, QString::number(m_spawnPoint->x()));
}
else
{
setText(tSpawnPointCoord1, QString::number(m_spawnPoint->x()));
setText(tSpawnPointCoord2, QString::number(m_spawnPoint->y()));
}
setText(tSpawnPointCoord3,
QString::number(m_spawnPoint->z(), 'f', 1));
// construct and set the time remaining string
if ( m_spawnPoint->diffTime() == 0 || m_spawnPoint->deathTime() == 0 )
tmpStr = "\277 ?"; // upside down questoin mark followed by question mark
else
{
long secs = m_spawnPoint->secsLeft();
if ( secs > 0 )
tmpStr.sprintf( "%2ld:%02ld", secs / 60, secs % 60 );
else
tmpStr = " now"; // spaces followed by now
}
setText(tSpawnPointRemaining, tmpStr);
// set the name and last spawn info
setText(tSpawnPointName, m_spawnPoint->name());
setText(tSpawnPointLast, m_spawnPoint->last());
// construct and set the spawned string
QDateTime dateTime;
dateTime.setTime_t( m_spawnPoint->spawnTime() );
QDate createDate = dateTime.date();
tmpStr = "";
// spawn time
if ( createDate != QDate::currentDate() )
tmpStr = createDate.dayName( createDate.dayOfWeek() ) + " ";
tmpStr += dateTime.time().toString();
// set when it spawned and the count
setText(tSpawnPointSpawned, tmpStr);
setText(tSpawnPointCount, QString::number(m_spawnPoint->count()));
}