• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TaskItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TaskItem的典型用法代码示例。如果您正苦于以下问题:C++ TaskItem类的具体用法?C++ TaskItem怎么用?C++ TaskItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: itemForIndex

int TreeModel::rowCount(const QModelIndex &parent) const
{
    if (parent.isValid() && parent.column() != 0)
        return 0;
    TaskItem *parentItem = itemForIndex(parent);
    return parentItem ? parentItem->childCount() : 0;
}
开发者ID:jhj,项目名称:aqp-qt5,代码行数:7,代码来源:treemodel.cpp


示例2: disconnect

void Task::setTask(AbstractGroupableItem *abstractItem)
{
    if (m_abstractItem)
    {
        disconnect(m_abstractItem, SIGNAL(destroyed()), this, SLOT(validate()));
    }

    m_abstractItem = abstractItem;
    m_command = QString();
    m_launcherUrl = KUrl();

    if (m_abstractItem)
    {
        if (m_validateTimer > 0)
        {
            killTimer(m_validateTimer);

            m_validateTimer = 0;
        }

        connect(m_abstractItem, SIGNAL(destroyed()), this, SLOT(validate()));
    }

    if (m_abstractItem->itemType() == TaskManager::GroupItemType)
    {
        m_group = qobject_cast<TaskGroup*>(abstractItem);
        m_taskType = GroupType;

        if (m_applet->groupManager()->groupingStrategy() != TaskManager::GroupManager::ManualGrouping && m_group->members().count())
        {
            TaskItem *task = qobject_cast<TaskItem*>(m_group->members().first());

            if (task && task->task())
            {
                if (m_group->name().isEmpty())
                {
                    m_group->setName(task->task()->visibleName());
                }

                if (m_applet->groupManager()->groupingStrategy() == TaskManager::GroupManager::ProgramGrouping)
                {
                    m_command = command(task->task()->pid());
                }
            }
        }

        QList<WId> windowList = windows();

        for (int i = 0; i < windowList.count(); ++i)
        {
            emit windowAdded(windowList.at(i));
        }

        connect(m_group, SIGNAL(changed(::TaskManager::TaskChanges)), this, SLOT(taskChanged(::TaskManager::TaskChanges)));
        connect(m_group, SIGNAL(groupEditRequest()), this, SLOT(showPropertiesDialog()));
        connect(m_group, SIGNAL(itemAdded(AbstractGroupableItem*)), this, SLOT(addItem(AbstractGroupableItem*)));
        connect(m_group, SIGNAL(itemRemoved(AbstractGroupableItem*)), this, SLOT(removeItem(AbstractGroupableItem*)));
    }
开发者ID:Arigotoma,项目名称:plasmoid-fancy-tasks,代码行数:58,代码来源:Task.cpp


示例3:

/**
 * \brief Find the index of the entry with the matching task id
 */
int	TaskMainWindow::indexForTask(int taskid) {
	for (int i = 0; i < ui->tasklistWidget->count(); i++) {
		QListWidgetItem	*lwi = ui->tasklistWidget->item(i);
		TaskItem	*ti = (TaskItem *)ui->tasklistWidget->itemWidget(lwi);
		if (ti->id() == taskid) {
			return i;
		}
	}
	return -1;
}
开发者ID:felipebetancur,项目名称:AstroPhotography-2,代码行数:13,代码来源:taskmainwindow.cpp


示例4: QModelIndex

QModelIndex TreeModel::index(int row, int column,
                             const QModelIndex &parent) const
{
    if (!rootItem || row < 0 || column < 0 || column >= ColumnCount
        || (parent.isValid() && parent.column() != 0))
        return QModelIndex();
    TaskItem *parentItem = itemForIndex(parent);
    Q_ASSERT(parentItem);
    if (TaskItem *item = parentItem->childAt(row))
        return createIndex(row, column, item);
    return QModelIndex();
}
开发者ID:jhj,项目名称:aqp-qt5,代码行数:12,代码来源:treemodel.cpp


示例5: debug

/**
 * \brief Retrieve a list of selected task ids
 *
 * This method scans the task list and constructs a list of tasks that
 * are selected.
 */
std::list<long>	TaskMainWindow::selectedTaskids() {
	debug(LOG_DEBUG, DEBUG_LOG, 0, "retrieve a list of selected items");
	std::list<long>	taskids;
	for (int i = 0; i < ui->tasklistWidget->count(); i++) {
		QListWidgetItem	*item = ui->tasklistWidget->item(i);
		if (item->isSelected()) {
			TaskItem	*ti = (TaskItem *)ui->tasklistWidget->itemWidget(item);
			taskids.push_back(ti->id());
		}
	}
	debug(LOG_DEBUG, DEBUG_LOG, 0, "%d selected task ids", taskids.size());
	return taskids;
}
开发者ID:felipebetancur,项目名称:AstroPhotography-2,代码行数:19,代码来源:taskmainwindow.cpp


示例6: rowCount

int TaskItemModel::rowCount(const QModelIndex &parent) const
{
    if (parent.column() > 0) {
        return 0;
    }

    TaskItem *parentTaskItem;
    if (!parent.isValid())
        parentTaskItem = m_taskManager->rootItem();
    else
        parentTaskItem = static_cast<TaskItem *>(parent.internalPointer());

    return parentTaskItem->count();
}
开发者ID:AlekseyDurachenko,项目名称:tomatotasktracker-desktop,代码行数:14,代码来源:taskitemmodel.cpp


示例7: addItem

void Task::addItem(AbstractGroupableItem *abstractItem)
{
    if (abstractItem->itemType() != TaskManager::GroupItemType)
    {
        TaskItem *task = qobject_cast<TaskItem*>(abstractItem);

        if (task->task())
        {
            emit windowAdded(task->task()->window());
        }
    }

    emit changed(WindowsChanged);
}
开发者ID:Arigotoma,项目名称:plasmoid-fancy-tasks,代码行数:14,代码来源:Task.cpp


示例8: announceItemChanged

void TreeModel::announceItemChanged(TaskItem *item)
{
    if (item == rootItem)
        return;
    TaskItem *parent = item->parent();
    Q_ASSERT(parent);
    int row = parent->rowOfChild(item);
    QModelIndex startIndex = createIndex(row, static_cast<int>(Name),
                                         item);
    QModelIndex endIndex = createIndex(row, static_cast<int>(Total),
                                       item);
    emit dataChanged(startIndex, endIndex);
    // Update the parent & parent's parent etc too
    announceItemChanged(parent);
}
开发者ID:jhj,项目名称:aqp-qt5,代码行数:15,代码来源:treemodel.cpp


示例9: QModelIndex

QModelIndex TaskItemModel::parent(const QModelIndex &index) const
{
    if (!index.isValid()) {
        return QModelIndex();
    }

    TaskItem *childTaskItem = static_cast<TaskItem *>(index.internalPointer());
    TaskItem *parentTaskItem = childTaskItem->parent();

    if (parentTaskItem == m_taskManager->rootItem()) {
        return QModelIndex();
    }

    return createIndex(parentTaskItem->calcIndex(), 0, parentTaskItem);
}
开发者ID:AlekseyDurachenko,项目名称:tomatotasktracker-desktop,代码行数:15,代码来源:taskitemmodel.cpp


示例10: removeItem

void Task::removeItem(AbstractGroupableItem *abstractItem)
{
    if (m_group && m_group->members().count() == 1)
    {
        m_taskType = TaskType;
        m_abstractItem = m_group->members().first();
        m_group = NULL;
        m_task = qobject_cast<TaskItem*>(m_abstractItem);
    }

    TaskItem *task = qobject_cast<TaskItem*>(abstractItem);

    if (task && task->task())
    {
        emit windowRemoved(task->task()->window());
    }

    emit changed(EveythingChanged);
}
开发者ID:Arigotoma,项目名称:plasmoid-fancy-tasks,代码行数:19,代码来源:Task.cpp


示例11: if

void Task::publishIconGeometry(const QRect &geometry)
{
    if (m_task && m_task->task())
    {
        m_task->task()->publishIconGeometry(geometry);
    }
    else if (m_group)
    {
        QList<AbstractGroupableItem*> items = m_group->members();

        for (int i = 0; i < items.count(); ++i)
        {
            if (items.at(i)->itemType() == TaskManager::TaskItemType)
            {
                TaskItem *task = qobject_cast<TaskItem*>(items.at(i));
                task->task()->publishIconGeometry(geometry);
            }
        }
    }
}
开发者ID:Arigotoma,项目名称:plasmoid-fancy-tasks,代码行数:20,代码来源:Task.cpp


示例12: actuallyRemoveStartup

void GroupManagerPrivate::actuallyRemoveStartup()
{
    if (startupRemoveList.isEmpty()) {
        return;
    }

    ::TaskManager::Startup *startup = startupRemoveList.takeFirst();

    if (!startupList.contains(startup)) {
        return;
    }

    TaskItem *item = startupList.take(startup);
    if (item->parentGroup()) {
        item->parentGroup()->remove(item);
    }

    item->setTaskPointer(0);

    foreach (LauncherItem * launcher, launchers) {
        launcher->removeItemIfAssociated(item);
    }
开发者ID:cmacq2,项目名称:plasma-workspace,代码行数:22,代码来源:groupmanager.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TaskManager类代码示例发布时间:2022-05-31
下一篇:
C++ TaskInfo类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap