本文整理汇总了C++中Todo::completed方法的典型用法代码示例。如果您正苦于以下问题:C++ Todo::completed方法的具体用法?C++ Todo::completed怎么用?C++ Todo::completed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Todo
的用法示例。
在下文中一共展示了Todo::completed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dtDue
bool Todo::operator==( const Todo &todo ) const
{
return
Incidence::operator==( todo ) &&
dtDue() == todo.dtDue() &&
hasDueDate() == todo.hasDueDate() &&
hasStartDate() == todo.hasStartDate() &&
completed() == todo.completed() &&
hasCompletedDate() == todo.hasCompletedDate() &&
percentComplete() == todo.percentComplete();
}
示例2: search
void SearchDialog::search(const QRegExp &re)
{
QDate startDt = mStartDate->date();
QDate endDt = mEndDate->date();
Event::List events;
if(mEventsCheck->isChecked())
{
events = mCalendar->events(startDt, endDt, mInclusiveCheck->isChecked());
}
Todo::List todos;
if(mTodosCheck->isChecked())
{
if(mIncludeUndatedTodos->isChecked())
{
Todo::List alltodos = mCalendar->todos();
Todo::List::iterator it;
Todo *todo;
for(it = alltodos.begin(); it != alltodos.end(); ++it)
{
todo = *it;
if((!todo->hasStartDate() && !todo->hasDueDate()) || // undated
(todo->hasStartDate() && (todo->dtStart() >= startDt) && (todo->dtStart() <= endDt)) || // start dt in range
(todo->hasDueDate() && (todo->dtDue().date() >= startDt) && (todo->dtDue() <= endDt)) || // due dt in range
(todo->hasCompletedDate() && (todo->completed().date() >= startDt) && (todo->completed() <= endDt))) // completed dt in range
{
todos.append(todo);
}
}
}
else
{
QDate dt = startDt;
while(dt <= endDt)
{
todos += mCalendar->todos(dt);
dt = dt.addDays(1);
}
}
}
Journal::List journals;
if(mJournalsCheck->isChecked())
{
QDate dt = startDt;
while(dt <= endDt)
{
journals += mCalendar->journals(dt);
dt = dt.addDays(1);
}
}
Incidence::List allIncidences = Calendar::mergeIncidenceList(events, todos, journals);
mMatchedEvents.clear();
Incidence::List::ConstIterator it;
for(it = allIncidences.begin(); it != allIncidences.end(); ++it)
{
Incidence *ev = *it;
if(mSummaryCheck->isChecked())
{
#if QT_VERSION >= 300
if(re.search(ev->summary()) != -1)
{
#else
if(re.match(ev->summary()) != -1)
{
#endif
mMatchedEvents.append(ev);
continue;
}
}
if(mDescriptionCheck->isChecked())
{
#if QT_VERSION >= 300
if(re.search(ev->description()) != -1)
{
#else
if(re.match(ev->description()) != -1)
{
#endif
mMatchedEvents.append(ev);
continue;
}
}
if(mCategoryCheck->isChecked())
{
#if QT_VERSION >= 300
if(re.search(ev->categoriesStr()) != -1)
{
#else
if(re.match(ev->categoriesStr()) != -1)
{
#endif
mMatchedEvents.append(ev);
continue;
}
}
}
}