?? setlocaltime.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 + -