! * \brief IPProcessStep::paint * \param painter * \param option * \param widget */
| 96 | * \param widget |
| 97 | */ |
| 98 | void IPProcessStep::paint(QPainter *painter, const QStyleOptionGraphicsItem*, QWidget*) |
| 99 | { |
| 100 | // shadow |
| 101 | painter->fillRect(QRect(10,10,48,48), QColor(0,0,0,50)); |
| 102 | |
| 103 | // pen |
| 104 | QPen pen(QColor(0,0,0)); |
| 105 | pen.setStyle(Qt::SolidLine); |
| 106 | pen.setWidth(1); |
| 107 | if(isSelected()) |
| 108 | { |
| 109 | pen.setColor(QColor(52, 152, 219)); |
| 110 | } |
| 111 | if(isEditing()) |
| 112 | { |
| 113 | pen.setColor(QColor(211, 84, 0)); |
| 114 | } |
| 115 | if(!process()->isResultReady()) |
| 116 | { |
| 117 | pen.setStyle(Qt::DotLine); |
| 118 | } |
| 119 | painter->setPen(pen); |
| 120 | |
| 121 | // brush |
| 122 | QBrush brush(Qt::white); |
| 123 | painter->setBrush(brush); |
| 124 | |
| 125 | // inputs |
| 126 | /*int input_y = 0; |
| 127 | for(int i=0; i < (int) process()->inputs()->size(); i++) |
| 128 | { |
| 129 | // check if output is free |
| 130 | if(!process()->inputs()->at(i).occupied) |
| 131 | { |
| 132 | painter->drawEllipse(0, input_y, 10, 10); |
| 133 | input_y += 20; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | // outputs |
| 138 | int output_y = 0; |
| 139 | for(int i=0; i < (int) process()->outputs()->size(); i++) |
| 140 | { |
| 141 | // check if output is free |
| 142 | if(!process()->outputs()->at(i).occupied) |
| 143 | { |
| 144 | painter->drawEllipse(55, output_y, 10, 10); |
| 145 | input_y += 20; |
| 146 | } |
| 147 | }*/ |
| 148 | |
| 149 | // main box |
| 150 | QRect rect(8,8,48,48); |
| 151 | //painter->fillRect(rect); |
| 152 | painter->drawRect(rect); |
| 153 | |
| 154 | // THUMBNAIL MODE |
| 155 | if(((IPProcessGridScene*) scene())->showThumbnails() && _thumbnail.height() > 0) |
nothing calls this directly
no test coverage detected