本文整理汇总了C++中DateTimeFieldsState::setYear方法的典型用法代码示例。如果您正苦于以下问题:C++ DateTimeFieldsState::setYear方法的具体用法?C++ DateTimeFieldsState::setYear怎么用?C++ DateTimeFieldsState::setYear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeFieldsState
的用法示例。
在下文中一共展示了DateTimeFieldsState::setYear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restoreFormControlState
DateTimeFieldsState DateTimeFieldsState::restoreFormControlState(const FormControlState& state)
{
DateTimeFieldsState dateTimeFieldsState;
dateTimeFieldsState.setYear(getNumberFromFormControlState(state, 0));
dateTimeFieldsState.setMonth(getNumberFromFormControlState(state, 1));
dateTimeFieldsState.setDayOfMonth(getNumberFromFormControlState(state, 2));
dateTimeFieldsState.setHour(getNumberFromFormControlState(state, 3));
dateTimeFieldsState.setMinute(getNumberFromFormControlState(state, 4));
dateTimeFieldsState.setSecond(getNumberFromFormControlState(state, 5));
dateTimeFieldsState.setMillisecond(getNumberFromFormControlState(state, 6));
dateTimeFieldsState.setWeekOfYear(getNumberFromFormControlState(state, 7));
dateTimeFieldsState.setAMPM(getAMPMFromFormControlState(state, 8));
return dateTimeFieldsState;
}
示例2: setOnlyYearMonthDay
void DateTimeEditElement::setOnlyYearMonthDay(const DateComponents& date)
{
ASSERT(date.type() == DateComponents::Date);
if (!m_editControlOwner)
return;
DateTimeFieldsState dateTimeFieldsState = valueAsDateTimeFieldsState();
dateTimeFieldsState.setYear(date.fullYear());
dateTimeFieldsState.setMonth(date.month() + 1);
dateTimeFieldsState.setDayOfMonth(date.monthDay());
setValueAsDateTimeFieldsState(dateTimeFieldsState);
m_editControlOwner->editControlValueChanged();
}
示例3: populateDateTimeFieldsState
void DateTimeYearFieldElement::populateDateTimeFieldsState(DateTimeFieldsState& dateTimeFieldsState)
{
dateTimeFieldsState.setYear(hasValue() ? valueAsInteger() : DateTimeFieldsState::emptyValue);
}