+ if (theWidgets.empty()) return;
+ bool isEnableStretch = true;
+ QList<ModuleBase_ModelWidget*>::const_iterator anIt = theWidgets.begin(), aLast =
+ theWidgets.end();
+ for (; anIt != aLast; anIt++) {
+ connect(*anIt, SIGNAL(keyReleased(QKeyEvent*)), this, SIGNAL(keyReleased(QKeyEvent*)));
+ connect(*anIt, SIGNAL(focusOutWidget(ModuleBase_ModelWidget*)),
+ this, SLOT(activateNextWidget(ModuleBase_ModelWidget*)));
+ connect(*anIt, SIGNAL(focusInWidget(ModuleBase_ModelWidget*)),
+ this, SLOT(activateWidget(ModuleBase_ModelWidget*)));
+
+ //ModuleBase_WidgetPoint2D* aPointWidget = dynamic_cast<ModuleBase_WidgetPoint2D*>(*anIt);
+ //if (aPointWidget)
+ // connect(aPointWidget, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)), this,
+ // SIGNAL(storedPoint2D(ObjectPtr, const std::string&)))
+ //}
+
+ if (!isEnableStretch) continue;
+ foreach(QWidget* eachWidget, (*anIt)->getControls()) {
+ QSizePolicy::Policy aVPolicy = eachWidget->sizePolicy().verticalPolicy();
+ if(aVPolicy == QSizePolicy::Expanding ||
+ aVPolicy == QSizePolicy::MinimumExpanding) {
+ isEnableStretch = false;
+ }
+ }
+ }
+ setStretchEnabled(isEnableStretch);
+ ModuleBase_ModelWidget* aLastWidget = theWidgets.last();
+ if (aLastWidget) {
+ QList<QWidget*> aControls = aLastWidget->getControls();
+ if (!aControls.empty()) {
+ QWidget* aLastControl = aControls.last();
+
+ QPushButton* anOkBtn = findChild<QPushButton*>(PROP_PANEL_OK);
+ QPushButton* aCancelBtn = findChild<QPushButton*>(PROP_PANEL_CANCEL);
+
+ setTabOrder(aLastControl, anOkBtn);
+ setTabOrder(anOkBtn, aCancelBtn);
+ }
+ }
+}
+
+const QList<ModuleBase_ModelWidget*>& XGUI_PropertyPanel::modelWidgets() const
+{
+ return myWidgets;