MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / paint

Method paint

ImagePlay/src/IPProcessStep.cpp:98–321  ·  view source on GitHub ↗

! * \brief IPProcessStep::paint * \param painter * \param option * \param widget */

Source from the content-addressed store, hash-verified

96 * \param widget
97 */
98void 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)

Callers

nothing calls this directly

Calls 7

processFunction · 0.85
showThumbnailsMethod · 0.80
heightMethod · 0.80
translateMethod · 0.80
hasErrorsMethod · 0.80
hasWarningsMethod · 0.80
useOpenCVMethod · 0.80

Tested by

no test coverage detected