当前位置: 首页>>代码示例>>C++>>正文


C++ CalendarItem::getSummary方法代码示例

本文整理汇总了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>");
    }
}
开发者ID:Fabijenna,项目名称:QOwnNotes,代码行数:12,代码来源:calendaritem.cpp

示例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;
    }
}
开发者ID:pbek,项目名称:QOwnNotes,代码行数:64,代码来源:tododialog.cpp

示例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();
    }
}
开发者ID:calis2002,项目名称:QOwnNotes,代码行数:74,代码来源:tododialog.cpp


注:本文中的CalendarItem::getSummary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。