本文整理汇总了C++中TaskInfo::show方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskInfo::show方法的具体用法?C++ TaskInfo::show怎么用?C++ TaskInfo::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskInfo
的用法示例。
在下文中一共展示了TaskInfo::show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showTaskContextMenu
void MainWindow::showTaskContextMenu(const QPoint &pos) {
QPoint globalPos = independentTasksTree->mapToGlobal(pos);
QMenu* menu = new QMenu(this);
Task* t;
QString selectedTask = independentTasksTree->indexAt(pos).data(Qt::DisplayRole).toString();
try {
t = &(NonPreemptiveFactory::getInstance().getTask(selectedTask));
if (t->getTaskType()==COMPOSITE) menu->addAction("add subtasks");
else {
menu->addAction("schedule programmation");
}
menu->addAction("edit constraints");
menu->addAction("infos");
menu->addAction("remove");
}
catch (CalendarException e) {return;}
QAction* selectedItem = menu->exec(globalPos);
if (selectedItem && selectedItem->text()=="add subtasks") {
AddTaskToCompositeTaskForm* form = new AddTaskToCompositeTaskForm(dynamic_cast<CompositeTask*>(t),this);
form->show();
}
if (selectedItem && selectedItem->text()=="remove") {
NonPreemptiveFactory::getInstance().removeTask(t);
refreshProjectsModel();
refreshIndependentTasksModel();
}
if (selectedItem && selectedItem->text()=="infos") {
TaskInfo* taskinfo = new TaskInfo(t,this);
taskinfo->show();
}
if (selectedItem && selectedItem->text()=="edit constraints") {
EditAssociationConstraint* editc = new EditAssociationConstraint(t,this);
editc->show();
}
}
示例2: showProjectContextMenu
void MainWindow::showProjectContextMenu(const QPoint &pos) {
QPoint globalPos = projectsTree->mapToGlobal(pos);
QMenu* menu = new QMenu(this);
Project* proj;
Task* t;
QString selectedProject = projectsTree->indexAt(pos).data(Qt::DisplayRole).toString();
if (!(projectsTreeView->isHidden()))
selectedProject = projectsTreeView->indexAt(pos).data(Qt::DisplayRole).toString();
try {
proj = &(ProjectFactory::getInstance().getProject(selectedProject));
menu->addAction("add tasks");
menu->addAction("infos");
menu->addAction("show tree");
menu->addAction("remove");
QAction* selectedItem = menu->exec(globalPos);
if (selectedItem && selectedItem->text()=="add tasks") {
AddTaskToProjectForm* form = new AddTaskToProjectForm(proj,this);
form->show();
}
if (selectedItem && selectedItem->text()=="remove") {
ProjectFactory::getInstance().removeProject(proj);
refreshProjectsModel();
refreshIndependentTasksModel();
}
if (selectedItem && selectedItem->text()=="infos") {
ProjectInfo* projectinfo = new ProjectInfo(proj,this);
projectinfo->show();
}
if (selectedItem && selectedItem->text()=="show tree") {
treeScene->clear();
if (projectsTreeView->isHidden()) {
itemTypeSelector->setCurrentIndex(2);
drawProjectTree(projectsTreeView->indexAt(pos)); // called from the projectsTreeView
}
else {
drawProjectTree(projectsTreeView->indexAt(pos)); // called from the projectsTree
}
calendarTable->hide();
treeView->show();
}
}
catch (CalendarException e) {
QString selectedTask = projectsTree->indexAt(pos).data(Qt::DisplayRole).toString();
if (!(projectsTreeView->isHidden()))
selectedTask = projectsTreeView->indexAt(pos).data(Qt::DisplayRole).toString();
try {
t = &(NonPreemptiveFactory::getInstance().getTask(selectedTask));
if (t->getTaskType()==COMPOSITE) menu->addAction("add subtasks");
else {
UnitaryTask* ut = &(NonPreemptiveFactory::getInstance().getTypedTask(selectedTask));
menu->addAction("schedule programmation");
}
menu->addAction("edit constraints");
menu->addAction("infos");
menu->addAction("remove");
QAction* selectedItem = menu->exec(globalPos);
if (selectedItem && selectedItem->text()=="add subtasks") {
AddTaskToCompositeTaskForm* form = new AddTaskToCompositeTaskForm(dynamic_cast<CompositeTask*>(t),this);
form->show();
}
if (selectedItem && selectedItem->text()=="remove") {
NonPreemptiveFactory::getInstance().removeTask(t);
refreshProjectsModel();
refreshIndependentTasksModel();
}
if (selectedItem && selectedItem->text()=="infos") {
TaskInfo* taskinfo = new TaskInfo(t,this);
taskinfo->show();
}
if (selectedItem && selectedItem->text()=="edit constraints") {
EditAssociationConstraint* editc = new EditAssociationConstraint(t,this);
editc->show();
}
}
catch (CalendarException e) {return;}
}
}