aBtn->setToolTip(tr("Ok"));
aBtn->setFlat(true);
aBtnLay->addWidget(aBtn);
- aBtn->installEventFilter(this);
aBtn = new QPushButton(QIcon(":pictures/button_cancel.png"), "", aFrm);
aBtn->setToolTip(tr("Cancel"));
myCustomWidget = new QWidget(aContent);
myMainLayout->addWidget(myCustomWidget);
myMainLayout->addStretch(1);
-
- aBtn->installEventFilter(this);
}
XGUI_PropertyPanel::~XGUI_PropertyPanel()
return myWidgets;
}
-bool XGUI_PropertyPanel::eventFilter(QObject *theObject, QEvent *theEvent)
-{
- QPushButton* anOkBtn = findChild<QPushButton*>(XGUI::PROP_PANEL_OK);
- QPushButton* aCancelBtn = findChild<QPushButton*>(XGUI::PROP_PANEL_CANCEL);
- if (theObject == anOkBtn || theObject == aCancelBtn) {
- if (theEvent->type() == QEvent::KeyRelease) {
- QKeyEvent* aKeyEvent = (QKeyEvent*) theEvent;
- if (aKeyEvent && (aKeyEvent->key() == Qt::Key_Return ||
- aKeyEvent->key() == Qt::Key_Enter)) {
- // TODO: this is enter button processing when the focus is on "Apply" or "Cancel" buttons
- //emit keyReleased("", (QKeyEvent*) theEvent);
- return true;
- }
- }
- }
- return QDockWidget::eventFilter(theObject, theEvent);
-}
-
QWidget* XGUI_PropertyPanel::contentWidget()
{
return myCustomWidget;
XGUI_PropertyPanel(QWidget* theParent);
virtual ~XGUI_PropertyPanel();
+ /// Returns main widget of the property panel, which children will be created
+ /// by WidgetFactory using the XML definition
QWidget* contentWidget();
+ /// Brings back all widget created by widget factory for signal/slot
+ /// connections and further processing
void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
+ /// Returns all property panel's widget created by WidgetFactory
const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
-
+ /// Removes all widgets in the widget area of the property panel
void cleanContent();
- virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
-
public slots:
void updateContentWidget(FeaturePtr theFeature);
/// slot to activate the next widget in the property panel
private:
QWidget* myCustomWidget;
-
QList<ModuleBase_ModelWidget*> myWidgets;
-
QVBoxLayout* myMainLayout;
};