void XGUI_PropertyPanel::cleanContent()
{
- myWidgets.clear();
-
- QLayoutItem* aItem = myMainLayout->takeAt(myMainLayout->count() - 1);
- delete aItem;
-
- myMainLayout->removeWidget(myCustomWidget);
- delete myCustomWidget;
-
- myCustomWidget = new QWidget(widget());
- myMainLayout->addWidget(myCustomWidget);
- myMainLayout->addStretch(1);
+ myWidgets.clear();
+ qDeleteAll(myCustomWidget->children());
}
void XGUI_PropertyPanel::setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets)
ModuleBase_WidgetPoint2D* aPointWidget = dynamic_cast<ModuleBase_WidgetPoint2D*>(*anIt);
if (aPointWidget)
- connect(aPointWidget, SIGNAL(storedPoint2D(FeaturePtr, const std::string&)),
- this, SIGNAL(storedPoint2D(FeaturePtr, const std::string&)));
+ connect(aPointWidget, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)),
+ this, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)));
}
ModuleBase_ModelWidget* aLastWidget = theWidgets.last();
if (aLastWidget) {
void XGUI_PropertyPanel::updateContentWidget(FeaturePtr theFeature)
{
foreach(ModuleBase_ModelWidget* eachWidget, myWidgets) {
- eachWidget->restoreValue(theFeature);
+ eachWidget->setFeature(theFeature);
+ eachWidget->restoreValue();
}
// the repaint is used here to immediatelly react in GUI to the values change.
repaint();
QList<ModuleBase_ModelWidget*>::const_iterator anIt = myWidgets.begin(),
aLast = myWidgets.end();
bool isFoundWidget = false;
- for (;anIt != aLast && !aNextWidget; anIt++)
- {
+ for (;anIt != aLast && !aNextWidget; anIt++) {
if (isFoundWidget || !theWidget) {
if ((*anIt)->focusTo()) {
aNextWidget = *anIt;