⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setlocaltime.cpp

📁 世界时间转换程序
💻 CPP
字号:
/****************************************************************************
** File: 'setlocaltime.cpp'
**
** Created: Sat Dec 29 18:58:32 2006
**      by: Wya ($Id: edited Sat Dec 29 18:58:32 2006 $)
**
** WARNING! All changes made by wya
**
****************************************************************************/

#include "setlocaltime.h"
/***
** construction
**  str name= zone Name : China , Europe , USA
***/
YSetLocalTime::YSetLocalTime(QWidget *parent ,YConfigure *conf, eTimeZone value) : QDialog(parent)
{
    setupUi(this);

	//get the name like "set China time"
	m_eTimeZone=value;
	setDialogTimeName(getTheTimeZoneName(m_eTimeZone));	

	m_LocalConf=conf;

	connect(btSave, SIGNAL(clicked(bool)), this, SLOT(slotbtSave(bool)));

}
/***
** deconstruction
**
***/
YSetLocalTime::~YSetLocalTime()
{
    

}
/***
** set groupbox name 
**
****/
void YSetLocalTime::setDialogTimeName(const QString &name)
{
// traceL3("YSetLocalTime::setDialogTimeName implememnt");
  m_LocalTimeName ="Set ";
  m_LocalTimeName =m_LocalTimeName+name;
  m_LocalTimeName=m_LocalTimeName+ " Time";
  qDebug(m_LocalTimeName.toAscii());  
  gbSetTime->setTitle(m_LocalTimeName);
}
/***
** get the time zone name 
**
***/
QString YSetLocalTime::getTheTimeZoneName(eTimeZone value)
{
	 QString str;
  switch (value )
  {
	  case eCHINA:
		str="China";
		break;
	  case eEUROPE:
	    str="Europe";
		break;
	  case eUSA:
	    str="USA";
		break;
	  case eERROR:
	  default:
	    str="Error";
		break;
  };
  return str;
}
/***
** slot the nutton click
**
***/
void  YSetLocalTime::slotbtSave(bool ok)
{	
	int i=cbOffset->currentIndex();
	int t=teOffset->time().hour();
	if(i==0)
	{
     t=t;
	}
	else
	{
     t=-t;
	}
	//set to the configure
  switch ( m_eTimeZone)
  {
	  case eCHINA:
		 m_LocalConf->setChinaTimeOffset(t);
		break;
	  case eEUROPE:
		 m_LocalConf->setEuropeTimeOffset(t);
		break;
	  case eUSA:
	    m_LocalConf->setUsaTimeOffset(t);
		break;
	  case eERROR:
	  default:
		break;
  }; 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -