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

Method showPropertyGroup

ImagePlay/src/IPProcessPropertiesWidget.cpp:401–428  ·  view source on GitHub ↗

! * \brief Iterates over all process property widgets and shows/hides * them based on group prefix * * Example for 2 groups: * -gauss_gamma * -gauss_deviation * -impulse_deviation * -impulse_type * * use * to show all groups * * \param prefix */

Source from the content-addressed store, hash-verified

399 * \param prefix
400 */
401void IPProcessPropertiesWidget::showPropertyGroup(QString prefix)
402{
403 for (int i = 0; i < layout()->count(); ++i)
404 {
405 IPPropertyWidget* widget = dynamic_cast<IPPropertyWidget*>(layout()->itemAt(i)->widget());
406
407 if(!widget || !widget->processProperty())
408 continue;
409
410 QString name(widget->processProperty()->name());
411
412 if(name.contains("_"))
413 {
414 QStringList nameParts = name.split("_");
415
416 // QFormLayout doesn't allow to show/hide rows,
417 // so it is easier to enable/disable the controls
418 if(nameParts[0] == prefix || prefix == "*")
419 {
420 widget->setEnabled(true);
421 }
422 else
423 {
424 widget->setEnabled(false);
425 }
426 }
427 }
428}

Callers

nothing calls this directly

Calls 2

containsMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected