MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / editNodeRow

Method editNodeRow

Gui/RenderStatsDialog.cpp:154–652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152 }
153
154 void editNodeRow(const NodePtr& node,
155 const NodeRenderStats& stats)
156 {
157 int row = -1;
158 bool exists = false;
159
160 for (std::size_t i = 0; i < rows.size(); ++i) {
161 NodePtr n = rows[i].lock();
162 if (n == node) {
163 row = i;
164 exists = true;
165 break;
166 }
167 }
168
169
170 if (row == -1) {
171 row = rows.size();
172 }
173
174 if ( row >= rowCount() ) {
175 insertRow(row);
176 }
177
178 QColor c;
179 NodeGuiPtr nodeUi = std::dynamic_pointer_cast<NodeGui>( node->getNodeGui() );
180 if (nodeUi) {
181 double r, g, b;
182 nodeUi->getColor(&r, &g, &b);
183 c.setRgbF(r, g, b);
184 }
185
186 {
187 TableItem* item = 0;
188 if (exists) {
189 item = view->item(row, COL_NAME);
190 } else {
191 item = new TableItem;
192
193 QString tt = NATRON_NAMESPACE::convertFromPlainText(tr("The label of the node as it appears on the nodegraph."), NATRON_NAMESPACE::WhiteSpaceNormal);
194 item->setToolTip(tt);
195 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
196 }
197 assert(item);
198 NodeGuiPtr nodeUi = std::dynamic_pointer_cast<NodeGui>( node->getNodeGui() );
199 if (nodeUi) {
200 item->setTextColor(Qt::black);
201 item->setBackgroundColor(c);
202 }
203 item->setText( QString::fromUtf8( node->getLabel().c_str() ) );
204 if (!exists) {
205 view->setItem(row, COL_NAME, item);
206 }
207 }
208
209
210 {
211 TableItem* item = 0;

Callers 1

addStatsMethod · 0.80

Calls 15

convertFromPlainTextFunction · 0.85
itemMethod · 0.80
setFlagsMethod · 0.80
setItemMethod · 0.80
isTilesSupportEnabledMethod · 0.80
appendMethod · 0.80
getChannelsRenderedMethod · 0.80
getInputImageIdentityMethod · 0.80
getIdentityRectanglesMethod · 0.80
getCacheAccessInfosMethod · 0.80

Tested by

no test coverage detected