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


C++ ListItem::setIcon方法代码示例

本文整理汇总了C++中ListItem::setIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ ListItem::setIcon方法的具体用法?C++ ListItem::setIcon怎么用?C++ ListItem::setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ListItem的用法示例。


在下文中一共展示了ListItem::setIcon方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: insertNewNote

void NotesWidget::insertNewNote(QString guid, QString noteBook, QString title)
{
    ListItem* item = new ListItem(this);
    item->setText(title);
    item->setNoteBookGUID(noteBook);
    item->setIcon(QIcon::fromTheme("basket"));
    item->setGUID(guid);

    signalsDisabled = true;
    setCurrentItem(item);
    signalsDisabled = false;
}
开发者ID:MidoriYakumo,项目名称:hippo,代码行数:12,代码来源:noteswidget.cpp

示例2: switchNotebook

void NotesWidget::switchNotebook(TreeItem::noteListType type, QStringList id, QString currentNote)
{
    listType = type;
    signalsDisabled = true;
    bool active = true;

    clear();

    QSqlQuery result;
    if (type == TreeItem::allNotes) {
        result.prepare("SELECT title, guid, notebookGuid, created, updated FROM notes WHERE active=:active");
        result.bindValue(":active", true);
    } else if ((type == TreeItem::noteBook) || (type == TreeItem::stack)) {
        result.prepare(QString("SELECT title, guid, notebookGuid, created, updated FROM notes WHERE notebookGuid IN (%1) AND active=:active").arg(AddSQLArray(id.count())));
        BindSQLArray(result, id);
        result.bindValue(":active", true);
    } else if (type == TreeItem::trashBin) {
        result.prepare("SELECT title, guid, notebookGuid, created, updated FROM notes WHERE active=:active");
        result.bindValue(":active", false);
        active = false;
    } else if (type == TreeItem::conflict) {
        result.prepare("SELECT notes.title, conflictingNotes.guid, notes.notebookGuid, notes.created, conflictingNotes.updated FROM conflictingNotes LEFT JOIN notes ON notes.guid = conflictingNotes.guid");
    }
    if (!result.exec())
        LOG_ERROR("SQL: " + result.lastError().text());

    while (result.next()) {
        ListItem* item = new ListItem(this);
        item->setText(result.value(0).toString());
        item->setGUID(result.value(1).toString());
        item->setNoteBookGUID(result.value(2).toString());
        item->setCreated(result.value(3).toLongLong());
        item->setModified(result.value(4).toLongLong());
        item->setIcon(QIcon::fromTheme("basket"));
        item->setActive(active);
        item->setSortType(sortType);
    }

    if (!currentNote.isEmpty())
        selectNoteWithGuid(currentNote);

    sortItems();

    signalsDisabled = false;
    emit reloaded();
}
开发者ID:MidoriYakumo,项目名称:hippo,代码行数:46,代码来源:noteswidget.cpp

示例3: switchTag

void NotesWidget::switchTag(QStringList id, QString currentNote)
{
    signalsDisabled = true;
    clear();

    if (id.isEmpty()) {
        signalsDisabled = false;
        return;
    }

    QSqlQuery result;

    result.prepare(QString("SELECT notes.title, notes.guid, notes.created, notes.updated FROM notesTags LEFT OUTER JOIN notes ON notesTags.noteGuid = notes.guid WHERE notesTags.guid IN (%1) AND notes.active=:active GROUP BY notesTags.noteGuid").arg(AddSQLArray(id.count())));
    BindSQLArray(result, id);

    result.bindValue(":active", true);
    if (!result.exec())
        LOG_ERROR("SQL: " + result.lastError().text());

    while (result.next()) {
        ListItem* item = new ListItem(this);
        item->setText(result.value(0).toString());
        item->setGUID(result.value(1).toString());
        item->setCreated(result.value(2).toLongLong());
        item->setModified(result.value(3).toLongLong());
        item->setIcon(QIcon::fromTheme("basket"));
        item->setSortType(sortType);
    }

    if (!currentNote.isEmpty())
        selectNoteWithGuid(currentNote);

    sortItems();

    signalsDisabled = false;
    emit reloaded();
}
开发者ID:MidoriYakumo,项目名称:hippo,代码行数:37,代码来源:noteswidget.cpp

示例4: switchSearch

void NotesWidget::switchSearch(QStringList guids, QString currentNote)
{
    signalsDisabled = true;
    clear();

    if (guids.isEmpty()) {
        signalsDisabled = false;
        return;
    }

    QSqlQuery result;
    result.prepare(QString("SELECT title, guid, created, updated FROM notes WHERE guid IN (%1)").arg(AddSQLArray(guids.count())));
    BindSQLArray(result, guids);

    if (!result.exec())
        LOG_ERROR("SQL: " + result.lastError().text());

    while (result.next()) {
        ListItem* item = new ListItem(this);
        item->setText(result.value(0).toString());
        item->setGUID(result.value(1).toString());
        item->setCreated(result.value(2).toLongLong());
        item->setModified(result.value(3).toLongLong());
        item->setIcon(QIcon::fromTheme("basket"));
        item->setSortType(sortType);
    }

    if (!currentNote.isEmpty())
        selectNoteWithGuid(currentNote);

    sortItems();

    signalsDisabled = false;
    emit reloaded();

}
开发者ID:MidoriYakumo,项目名称:hippo,代码行数:36,代码来源:noteswidget.cpp


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