Hide internal widgets.
//Create a widget (doublevalue, groupbox, toolbox, etc.
QWidget* aWidget = createWidgetByType(aWdgType, theParent);
if (aWidget) {
- aWidgetLay->addWidget(aWidget);
+ if (!isInternalWidget(aWdgType)) {
+ aWidgetLay->addWidget(aWidget);
+ }
+ else
+ aWidget->setVisible(false);
}
if (myWidgetApi->isContainerWidget()) {
//if current widget is groupbox (container) process it's children recursively
return QString::fromStdString(theStdString);
}
+bool ModuleBase_WidgetFactory::isInternalWidget(const std::string& theType)
+{
+ std::string prop = myWidgetApi->getProperty(FEATURE_INTERNAL);
+
+ std::transform(prop.begin(), prop.end(), prop.begin(), ::tolower);
+ if(prop.empty() || prop == "false" || prop == "0") {
+ return false;
+ }
+ return true;
+}
QWidget* ModuleBase_WidgetFactory::selectorControl(QWidget* theParent)
{
QWidget* booleanControl(QWidget* theParent);
QWidget* point2dDistanceControl(QWidget* theParent);
+ /// Check whether the XML definition for the given type contains internal property
+ /// \param theType the widget type
+ /// \return the boolean result
+ bool isInternalWidget(const std::string& theType);
+
QString qs(const std::string& theStdString) const;
private:
<feature id="SketchConstraintCoincidence" title="Points coincidence" tooltip="Create constraint for the coincidence of two points" internal="1"/>
<feature id="SketchConstraintDistance" title="Distance between objects" tooltip="Create constraint for the distance from a point to an object">
<label title="Select point and another feature (point or point on line) between which to calculate distance" tooltip="Select point and another feature (point or point on line) between which to calculate distance"/>
- <feature_selector id="ConstraintEntityA" keysequence="SketchPoint"/>
- <feature_selector id="ConstraintEntityB" keysequence="SketchPoint"/>
- <point_selector id="ConstraintFlyoutValuePnt" title="Flyout point" tooltip="Flyout"/>
+ <feature_selector id="ConstraintEntityA" keysequence="SketchPoint" internal="1"/>
+ <feature_selector id="ConstraintEntityB" keysequence="SketchPoint" internal="1"/>
+ <point_selector id="ConstraintFlyoutValuePnt" title="Flyout point" tooltip="Flyout" internal="1"/>
<doublevalue_editor id="ConstraintValue" min="0" step="1.0" tooltip="Constraint value"/>
</feature>
<feature id="SketchConstraintLength" title="Length of a line" tooltip="Create constraint for the given length of a line segment">