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

Method init

ImagePlay/src/IPProcessPropertiesWidget.cpp:46–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void IPProcessPropertiesWidget::init(IPProcessStep* processStep)
47{
48 _processStep = processStep;
49
50 // remove all children
51 while (layout()->count() > 0)
52 {
53 QLayoutItem* item = layout()->takeAt(0);
54 if(item != NULL )
55 {
56 delete item->widget();
57 delete item;
58 }
59 }
60// delete layout();
61
62 auto* processSettings = _processStep->process()->properties();
63
64 if(processSettings->size() == 0)
65 {
66 addPropertyWidget("This step has no properties.", "", NULL);
67 }
68
69 // sort the properties by user set position
70 std::vector<IPLProcessProperty*> orderedProperties;
71 orderedProperties.reserve(processSettings->size());
72
73 for (auto &entry: *processSettings)
74 orderedProperties.push_back(entry.second.get());
75
76 std::sort(orderedProperties.begin(), orderedProperties.end(), IPProcessPropertiesWidget::sortByPosition);
77
78 // create all property widgets
79 for (auto &property: orderedProperties)
80 {
81 // generate GUI based on the property type
82
83 if (property->widget() == IPL_WIDGET_HIDDEN) {} //Don't process hidden widgets
84 else if (property->widget() == IPL_WIDGET_LABEL) //Labels are type independent
85 {
86 QFormLayout* layout = (QFormLayout*) this->layout();
87
88 QLabel* lblDescription = new QLabel(property->description());
89 lblDescription->setWordWrap(true);
90 lblDescription->setStyleSheet("color: #666; font-size: 10px");
91 layout->addRow("", lblDescription);
92
93 // add widget to list
94 //_propertyWidgets.append(lblDescription);
95 }
96
97 else if (auto p = dynamic_cast<IPLProcessPropertyInt*>(property))
98 {
99 IPPropertyWidget *widget = NULL;
100 QString rawName, name;
101 switch(p->widget())
102 {
103 case IPL_WIDGET_SLIDER:

Callers

nothing calls this directly

Calls 10

propertiesMethod · 0.80
defaultImagePathMethod · 0.80
imageViewerMethod · 0.80
processMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
getMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected