#include <XGUI_PropertyPanel.h>
#include <XGUI_Constants.h>
-#include <ModuleBase_WidgetPoint2D.h>
+ #include <ModuleBase_WidgetMultiSelector.h>
#include <QWidget>
#include <QVBoxLayout>
void XGUI_PropertyPanel::setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets)
{
myWidgets = theWidgets;
- int aS = myWidgets.size();
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(focusOutWidget(ModuleBase_ModelWidget*)),
+ this, SLOT(activateNextWidget(ModuleBase_ModelWidget*)));
connect(*anIt, SIGNAL(focusInWidget(ModuleBase_ModelWidget*)),
- this, SLOT(activateWidget(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&)));
+ //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();