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


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

本文整理汇总了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()));
}
开发者ID:carriercomm,项目名称:showeq,代码行数:50,代码来源:spawnpointlist.cpp


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