本文整理汇总了C++中Duration::isDaily方法的典型用法代码示例。如果您正苦于以下问题:C++ Duration::isDaily方法的具体用法?C++ Duration::isDaily怎么用?C++ Duration::isDaily使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Duration
的用法示例。
在下文中一共展示了Duration::isDaily方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPeriod
/******************************************************************************
* Initialise the controls with a specified time period.
* The time unit combo-box is initialised to 'defaultUnits', but if 'dateOnly'
* is true, it will never be initialised to minutes or hours/minutes.
*/
void TimePeriod::setPeriod(const Duration& perod, bool dateOnly, TimePeriod::Units defaultUnits)
{
Duration oldinterval = period();
if (!dateOnly && mNoHourMinute)
dateOnly = true;
int item;
if (perod)
{
int count = perod.value();
if (perod.isDaily())
{
if (count % 7)
item = Days;
else
{
item = Weeks;
count /= 7;
}
}
else
{
count /= 60; // minutes
item = (defaultUnits == Minutes && count <= mSpinBox->maximum()) ? Minutes : HoursMinutes;
}
if (item < mDateOnlyOffset)
item = mDateOnlyOffset;
else if (item > mMaxUnitShown)
item = mMaxUnitShown;
mUnitsCombo->setCurrentIndex(item - mDateOnlyOffset);
if (item == HoursMinutes)
mTimeSpinBox->setValue(count);
else
mSpinBox->setValue(count);
item = setDateOnly(perod, dateOnly, false);
}
else
{
item = defaultUnits;
if (item < mDateOnlyOffset)
item = mDateOnlyOffset;
else if (item > mMaxUnitShown)
item = mMaxUnitShown;
mUnitsCombo->setCurrentIndex(item - mDateOnlyOffset);
if ((dateOnly && !mDateOnlyOffset) || (!dateOnly && mDateOnlyOffset))
item = setDateOnly(perod, dateOnly, false);
}
setUnitRange();
showHourMin(item == HoursMinutes && !mNoHourMinute);
Duration newinterval = period();
if (newinterval != oldinterval)
emit valueChanged(newinterval);
}
示例2: d
Period::Period( const KDateTime &start, const Duration &duration )
: d( new KCalCore::Period::Private( start, duration.end( start ), true ) )
{
d->mDailyDuration = duration.isDaily();
}