本文整理汇总了C++中CalendarItem::getSummary方法的典型用法代码示例。如果您正苦于以下问题:C++ CalendarItem::getSummary方法的具体用法?C++ CalendarItem::getSummary怎么用?C++ CalendarItem::getSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CalendarItem
的用法示例。
在下文中一共展示了CalendarItem::getSummary方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: alertTodoReminders
/**
* @brief Shows alerts for calendar items with an alarm date in the current minute
*/
void CalendarItem::alertTodoReminders() {
QList<CalendarItem> calendarItemList = fetchAllForReminderAlert();
QListIterator<CalendarItem> itr(calendarItemList);
while (itr.hasNext()) {
CalendarItem calItem = itr.next();
QMessageBox::information(NULL, "Reminder", "Reminder: <strong>" + calItem.getSummary() + "</strong>");
}
}
示例2: reloadTodoListItems
/**
* Reloads the task list from the SQLite database
*/
void TodoDialog::reloadTodoListItems() {
QList<CalendarItem> calendarItemList = CalendarItem::fetchAllByCalendar(
ui->todoListSelector->currentText());
int itemCount = calendarItemList.count();
MetricsService::instance()->sendEventIfEnabled(
"todo/list/loaded",
"todo",
"todo list loaded",
QString::number(itemCount) + " todo items",
itemCount);
{
const QSignalBlocker blocker(ui->todoList);
Q_UNUSED(blocker);
ui->todoList->clear();
QListIterator<CalendarItem> itr(calendarItemList);
while (itr.hasNext()) {
CalendarItem calItem = itr.next();
// skip completed items if the "show completed items" checkbox
// is not checked
if (!ui->showCompletedItemsCheckBox->checkState()) {
if (calItem.isCompleted()) {
continue;
}
}
QString uid = calItem.getUid();
// skip items that were not fully loaded yet
if (uid == "") {
continue;
}
QListWidgetItem *item = new QListWidgetItem(calItem.getSummary());
item->setData(Qt::UserRole, uid);
item->setCheckState(
calItem.isCompleted() ? Qt::Checked : Qt::Unchecked);
item->setFlags(
Qt::ItemIsDragEnabled |
Qt::ItemIsDropEnabled |
Qt::ItemIsEnabled |
Qt::ItemIsUserCheckable |
Qt::ItemIsSelectable);
ui->todoList->addItem(item);
}
}
// set the current row of the task list to the first row
jumpToTodoListItem();
// set the focus to the description edit if we wanted to
if (_setFocusToDescriptionEdit) {
ui->descriptionEdit->setFocus();
_setFocusToDescriptionEdit = false;
}
}
示例3: reloadTodoListItems
/**
* @brief Reloads the todo list from the SQLite database
*/
void TodoDialog::reloadTodoListItems() {
QList<CalendarItem> calendarItemList = CalendarItem::fetchAllByCalendar(
ui->todoListSelector->currentText());
MetricsService::instance()->sendEvent(
"note", "todo list loaded", "", calendarItemList.count());
{
const QSignalBlocker blocker(ui->todoList);
Q_UNUSED(blocker);
ui->todoList->clear();
QListIterator<CalendarItem> itr(calendarItemList);
while (itr.hasNext()) {
CalendarItem calItem = itr.next();
// skip completed items if the "show completed items" checkbox
// is not checked
if (!ui->showCompletedItemsCheckBox->checkState()) {
if (calItem.isCompleted()) {
continue;
}
}
QString uid = calItem.getUid();
// skip items that were not fully loaded yet
if (uid == "") {
continue;
}
QListWidgetItem *item = new QListWidgetItem(calItem.getSummary());
item->setWhatsThis(uid);
item->setCheckState(
calItem.isCompleted() ? Qt::Checked : Qt::Unchecked);
item->setFlags(
Qt::ItemIsDragEnabled |
Qt::ItemIsDropEnabled |
Qt::ItemIsEnabled |
Qt::ItemIsUserCheckable |
Qt::ItemIsSelectable);
ui->todoList->addItem(item);
}
}
// set the current row of the todo list to the first row
if (ui->todoList->count() > 0) {
int row = -1;
// try to find a possible last created calendar item
if (lastCreatedCalendarItem.isFetched()) {
row = findTodoItemRowByUID(lastCreatedCalendarItem.getUid());
// clear the last created calendar item if we found it in the list
if (row > -1) {
lastCreatedCalendarItem = CalendarItem();
}
}
if (row == -1) {
// try to find the currently selected calendar item
row = findTodoItemRowByUID(currentCalendarItem.getUid());
}
ui->todoList->setCurrentRow(row >= 0 ? row : 0);
} else {
resetEditFrameControls();
}
}