| 62 | } |
| 63 | |
| 64 | void IPProcessList::addProcessItem(QString processID, QString text, QString keywords, IPLProcess::IPLProcessCategory category) |
| 65 | { |
| 66 | // load icon from png file and add background color based on the process category |
| 67 | |
| 68 | QFileInfo iconFile(_mainWindow->processIconPath(processID)); |
| 69 | |
| 70 | if(!iconFile.exists()) |
| 71 | { |
| 72 | iconFile = QFileInfo(_mainWindow->processIconPath("Plugin")); |
| 73 | } |
| 74 | |
| 75 | QPixmap finalIcon(25,25); |
| 76 | |
| 77 | if(iconFile.exists()) |
| 78 | { |
| 79 | QPixmap transparentIcon(iconFile.absoluteFilePath()); |
| 80 | |
| 81 | QPainter painter(&finalIcon); |
| 82 | painter.fillRect(0,0,25,25,_categoryColors.at(category)); |
| 83 | painter.drawPixmap(0,0,25,25,transparentIcon); |
| 84 | } |
| 85 | |
| 86 | QListWidgetItem* newItem = new QListWidgetItem(finalIcon, text); |
| 87 | newItem->setToolTip(processID); |
| 88 | newItem->setStatusTip(keywords); |
| 89 | newItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled); |
| 90 | |
| 91 | addItem(newItem); |
| 92 | } |
| 93 | |
| 94 | void IPProcessList::startDrag(Qt::DropActions) |
| 95 | { |
no test coverage detected