本文整理汇总了C++中WDate::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ WDate::toString方法的具体用法?C++ WDate::toString怎么用?C++ WDate::toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WDate
的用法示例。
在下文中一共展示了WDate::toString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setDate
void WDatePicker::setDate(const WDate& date)
{
if (!date.isNull()) {
forEdit_->setText(date.toString(format_));
calendar_->select(date);
calendar_->browseTo(date);
}
}
示例2: setDate
void WDateEdit::setDate(const WDate& date)
{
if (!date.isNull()) {
setText(date.toString(format()));
calendar_->select(date);
calendar_->browseTo(date);
}
}
示例3: setFromCalendar
void WDateEdit::setFromCalendar()
{
if (!calendar_->selection().empty()) {
WDate calDate = Utils::first(calendar_->selection());
setText(calDate.toString(format()));
changed().emit();
}
}
示例4: select
void Calendar::select(const WDate& date)
{
selection_.clear();
selection_.insert(date);
if (isRendered())
addUpdateJS(elVar() + ".setValue(Date.parseDate('"
+ date.toString("dd/MM/yyyy").toUTF8() + "','d/m/Y');");
}
示例5: handleFinish
void PriceEditDialog::handleFinish(DialogCode result)
{
if (result == WDialog::Accepted)
{
/*
* Update the model with data from the edit widgets.
*
* You will want to do some validation here...
*
* Note that we directly update the source model to avoid
* problems caused by the dynamic sorting of the proxy model,
* which reorders row numbers, and would cause us to switch to editing
* the wrong data.
*/
if(m_chbCostEnabled->isChecked() && m_chbPercentEnabled->isChecked())
{
WMessageBox::show("Error", WString(tr("msg.ambiguous.select")), Ok);
return;
}
/*! При выставленном варианте расчета статический Поле цена не доступна
1) Вариант расчета 0 Динамический 1 Статический
2) Устанавливается Цена или процент
3) Процента или Цена
*/
WAbstractItemModel *m = m_model;
//int id =
int modelRow = m_item.row();
int valueType = 0;
int modifyStatic = 0;
//int staticValue = 0;
double value = 0.00;
//char number[50];
WAbstractProxyModel *proxyModel = dynamic_cast<WAbstractProxyModel *>(m);
if (proxyModel)
{
m = proxyModel->sourceModel();
modelRow = proxyModel->mapToSource(m_item).row();
}
//modelRow++;
if(m_chbPercentEnabled->isChecked())
{
valueType = 2;
//sprintf(number,"%.2f%%",boost::lexical_cast<double>(m_lePercent->text().toUTF8()));
//m->setData(modelRow, 3, boost::any(std::string("0.00")));
m->setData(modelRow, 5, boost::any(m_lePercent->text().toUTF8()+"%"));/// Процент
m->setData(modelRow, 2, boost::any(value = boost::lexical_cast<double>(m_lePercent->text().toUTF8())),UserRole);/// Процент
}else if(m_chbCostEnabled->isChecked())
{
valueType = 1;
//m->setData(modelRow, 3, boost::any(boost::lexical_cast<double>(m_leCost->text().toUTF8())));/// Цена
//sprintf(number,"%.2f%%",boost::lexical_cast<double>(m_leCost->text().toUTF8()));
//m->setData(modelRow, 2, boost::any(std::string("0.00%")));
m->setData(modelRow, 6, boost::any(m_leCost->text().toUTF8()));/// Цена
m->setData(modelRow, 2, boost::any(value = boost::lexical_cast<double>(m_leCost->text().toUTF8())),UserRole);/// Цена
}else{
if(atof(m_leCost->text().toUTF8().c_str()) || atof(m_lePercent->text().toUTF8().c_str()))
WMessageBox::show("Error", WString(tr("msg.notselected.valuetype")), Ok);
}
if(m_chbModifyStatic->isChecked())
modifyStatic = 1;
//log("info")<<" Percetn "<<valueType<<" Dinamic "<<m_rbGroup->checkedId();
m->setData(modelRow, 3, boost::any(valueType),UserRole); /// Value type Процент / Цена
m->setData(modelRow, 4, boost::any(m_rbGroup->checkedId()),UserRole); /// PriceType Динамический статический
m->setData(modelRow, 5, boost::any(modifyStatic),UserRole); /// Изменять фиксированные цены
m->setData(modelRow, 6, boost::any(m_dpModified->date()),UserRole);
m->setData(modelRow, 7, boost::any(m_roundingMethod->currentIndex()+1),UserRole);
int priceType = ((m_rbGroup->checkedId()-1)<<1) | (valueType-1);
bool changeFixed = false;
WDate modifiDate = WDate::currentDate();
#ifdef DEBUG
log("info")<<"updateUserPrice(m_id "<<m_id<<",valueType "<<valueType<<",value "<<value<<",priceType "<<priceType<<",changeFixed "<<changeFixed<<",modifiDate "<<modifiDate.toString()<<" rounding "<<m_roundingMethod->currentIndex()+1<<" ) "<<__LINE__;
#endif
((Portal *)WApplication::instance())->getSession()->updateUserPrice(m_id,valueType,value,priceType,changeFixed,modifiDate,m_roundingMethod->currentIndex()+1);
}
delete this;
}
示例6: setDate
void DateField::setDate(const WDate& date)
{
lineEdit()->setText(date.toString(format_));
}