SHAPER  9.12.0
XGUI_PropertyPanel Class Reference

Realization of Property panel object. More...

Inheritance diagram for XGUI_PropertyPanel:
Inheritance graph

Public Slots

void updateContentWidget (FeaturePtr theFeature)
 Update all widgets in property panel with values from the given feature. More...
 
void createContentPanel (FeaturePtr theFeature)
 If the XML definition of the feature contains information about specific content of the property panel, it creates the panel and allow filling it by the given feature. More...
 
virtual void activateWidget (ModuleBase_ModelWidget *theWidget, const bool theEmitSignal=true)
 Makes the given widget active, highlights it and removes highlighting from the previous active widget. More...
 
void onFocusInWidget (ModuleBase_ModelWidget *theWidget)
 Activates the parameter widget if it can accept focus. More...
 
void onActivateNextWidget (ModuleBase_ModelWidget *theWidget)
 Activate next widget. More...
 

Signals

void enterClicked (QObject *theObject)
 The signal is emitted if the enter is clicked in the control of the widget. More...
 
void propertyPanelDeactivated ()
 Emits on deactivating property panel (e.g. by clearContent) More...
 
void propertyPanelActivated ()
 Emits on widget activating. More...
 
void keyReleased (QObject *theObject, QKeyEvent *theEvent)
 The signal about key release on the control, that corresponds to the attribute. More...
 
void beforeWidgetActivated (ModuleBase_ModelWidget *theWidget)
 The signal about the widget activation. More...
 
void noMoreWidgets (const std::string &thePreviousAttributeID)
 The signal about the widget activation. More...
 

Public Member Functions

 XGUI_PropertyPanel (QWidget *theParent, XGUI_OperationMgr *theMgr)
 Constructor. More...
 
virtual QWidgetheaderWidget () const
 Returns header widget. More...
 
ModuleBase_PageBasecontentWidget ()
 Returns main widget of the property panel, which children will be created by WidgetFactory using the XML definition. More...
 
void setModelWidgets (const QList< ModuleBase_ModelWidget * > &theWidgets)
 Brings back all widget created by widget factory for signal/slot connections and further processing. More...
 
virtual const QList< ModuleBase_ModelWidget * > & modelWidgets () const
 Returns all property panel's widget created by WidgetFactory. More...
 
virtual void cleanContent ()
 Removes all widgets in the widget area of the property panel. More...
 
virtual ModuleBase_ModelWidgetactiveWidget (const bool isUseCustomWidget=false) const
 Returns currently active widget. More...
 
virtual void activateNextWidget (ModuleBase_ModelWidget *theWidget)
 Activate the next widget in the property panel. More...
 
virtual void activateNextWidget ()
 Activate the next from current widget in the property panel. More...
 
virtual void setFocusOnOkButton ()
 Set focus on the Ok button. More...
 
virtual void setCancelEnabled (bool theEnabled)
 Set Enable/Disable state of Cancel button. More...
 
virtual bool isCancelEnabled () const
 
virtual void setEditingMode (bool isEditing)
 Editing mode depends on mode of current operation. More...
 
void setupActions (XGUI_ActionsMgr *theMgr)
 Allows to set predefined actions for the property panel fetched from the ActionsMgr. More...
 
virtual ModuleBase_ModelWidgetpreselectionWidget () const
 Returns widget processed by preselection. More...
 
virtual void setPreselectionWidget (ModuleBase_ModelWidget *theWidget)
 Sets widget processed by preselection. More...
 
XGUI_OperationMgroperationMgr () const
 Returns operation manager. More...
 
QToolButton * findButton (const char *theInternalName) const
 Find under the panel a child button with the parameter name. More...
 
bool setFocusNextPrevChild (bool theIsNext)
 Possibility to process focus by method, for example when Tab or SHIF+Tab is pressed but property panel is not active widget. More...
 
virtual void onAcceptData ()
 The method is called on accepting of operation. More...
 
void setInternalActiveWidget (ModuleBase_ModelWidget *theWidget)
 Set internal active widget, that can be returned as active widget and participate in active selection filters/modes in application. More...
 
void updateApplyPlusButton (FeaturePtr theFeature)
 
virtual ModuleBase_ModelWidgetmodelWidget (const std::string &theAttributeId) const
 Returns widget, that has the given attribute index. More...
 
bool isEditingMode () const
 
ModuleBase_ModelWidgetfindFirstAcceptingValueWidget ()
 Returns the first widget, where canAcceptFocus returns true. More...
 
virtual bool isModified () const
 Returns True if data of its feature was modified during operation. More...
 

Static Public Member Functions

static ModuleBase_ModelWidgetfindFirstAcceptingValueWidget (const QList< ModuleBase_ModelWidget * > &theWidgets)
 Returns the first widget, where canAcceptFocus returns true. More...
 

Protected Member Functions

bool setActiveWidget (ModuleBase_ModelWidget *theWidget, const bool isEmitSignal)
 Makes the widget active, deactivate the previous, activate and hightlight the given one. More...
 
virtual bool focusNextPrevChild (bool theIsNext)
 The parent method that processes the "Tab"/"SHIF + Tab" keyboard events Emits a signal about focus change If theIsNext is true, this function searches forward, if next is false, it searches backward. More...
 
void activateNextWidget (ModuleBase_ModelWidget *theWidget, const bool isCheckVisibility)
 Activate the next widget in the property panel. More...
 
void closeEvent (QCloseEvent *theEvent)
 A method called on the property panel closed. More...
 

Protected Attributes

bool myIsEditing
 Flag which shows that current operation is in editing mode. More...
 

Detailed Description

Realization of Property panel object.

Constructor & Destructor Documentation

◆ XGUI_PropertyPanel()

XGUI_PropertyPanel::XGUI_PropertyPanel ( QWidget theParent,
XGUI_OperationMgr theMgr 
)

Constructor.

Parameters
theParentis a parent of the property panel
theMgroperation manager

Member Function Documentation

◆ headerWidget()

virtual QWidget* XGUI_PropertyPanel::headerWidget ( ) const
inlinevirtual

Returns header widget.

Implements ModuleBase_IPropertyPanel.

◆ contentWidget()

ModuleBase_PageBase * XGUI_PropertyPanel::contentWidget ( )

Returns main widget of the property panel, which children will be created by WidgetFactory using the XML definition.

◆ setModelWidgets()

void XGUI_PropertyPanel::setModelWidgets ( const QList< ModuleBase_ModelWidget * > &  theWidgets)

Brings back all widget created by widget factory for signal/slot connections and further processing.

◆ modelWidgets()

const QList< ModuleBase_ModelWidget * > & XGUI_PropertyPanel::modelWidgets ( ) const
virtual

Returns all property panel's widget created by WidgetFactory.

Implements ModuleBase_IPropertyPanel.

◆ cleanContent()

void XGUI_PropertyPanel::cleanContent ( )
virtual

Removes all widgets in the widget area of the property panel.

as the widgets are deleted later, it is important that the signals of these widgets are not processed. An example of the error is issue 986. In the given case, the property panel is firstly filled by new widgets of restarted operation and after that the mouse release signal come from the widget of the previous operation (Point2d widget about mouse is released and focus is out of this widget)

by default it is hidden

Implements ModuleBase_IPropertyPanel.

◆ activeWidget()

ModuleBase_ModelWidget * XGUI_PropertyPanel::activeWidget ( const bool  isUseCustomWidget = false) const
virtual

Returns currently active widget.

This is a widget from internal container of widgets (myWidgets) activated/deactivated by focus in property panel. If parameter is true, the method finds firstly the custom widget, after the direct active widget.

Parameters
isUseCustomWidgetboolean state if the custom widget might be a result

Implements ModuleBase_IPropertyPanel.

◆ activateNextWidget() [1/3]

void XGUI_PropertyPanel::activateNextWidget ( ModuleBase_ModelWidget theWidget)
virtual

Activate the next widget in the property panel.

Parameters
theWidgeta widget. The next widget should be activated

Implements ModuleBase_IPropertyPanel.

◆ activateNextWidget() [2/3]

void XGUI_PropertyPanel::activateNextWidget ( )
virtual

Activate the next from current widget in the property panel.

Implements ModuleBase_IPropertyPanel.

◆ setFocusOnOkButton()

void XGUI_PropertyPanel::setFocusOnOkButton ( )
virtual

Set focus on the Ok button.

Implements ModuleBase_IPropertyPanel.

◆ setCancelEnabled()

void XGUI_PropertyPanel::setCancelEnabled ( bool  theEnabled)
virtual

Set Enable/Disable state of Cancel button.

Parameters
theEnabledEnable/Disable state of Cancel button

Implements ModuleBase_IPropertyPanel.

◆ isCancelEnabled()

bool XGUI_PropertyPanel::isCancelEnabled ( ) const
virtual
Returns
Enable/Disable state of Cancel button

Implements ModuleBase_IPropertyPanel.

◆ setEditingMode()

void XGUI_PropertyPanel::setEditingMode ( bool  isEditing)
virtual

Editing mode depends on mode of current operation.

This value is defined by it.

Parameters
isEditingstate of editing mode flag

Reimplemented from ModuleBase_IPropertyPanel.

◆ setupActions()

void XGUI_PropertyPanel::setupActions ( XGUI_ActionsMgr theMgr)

Allows to set predefined actions for the property panel fetched from the ActionsMgr.

◆ preselectionWidget()

ModuleBase_ModelWidget * XGUI_PropertyPanel::preselectionWidget ( ) const
virtual

Returns widget processed by preselection.

Implements ModuleBase_IPropertyPanel.

◆ setPreselectionWidget()

void XGUI_PropertyPanel::setPreselectionWidget ( ModuleBase_ModelWidget theWidget)
virtual

Sets widget processed by preselection.

Implements ModuleBase_IPropertyPanel.

◆ operationMgr()

XGUI_OperationMgr* XGUI_PropertyPanel::operationMgr ( ) const
inline

Returns operation manager.

◆ findButton()

QToolButton * XGUI_PropertyPanel::findButton ( const char *  theInternalName) const

Find under the panel a child button with the parameter name.

Parameters
theInternalNamea button object name
Returns
button instance or NULL

◆ setFocusNextPrevChild()

bool XGUI_PropertyPanel::setFocusNextPrevChild ( bool  theIsNext)

Possibility to process focus by method, for example when Tab or SHIF+Tab is pressed but property panel is not active widget.

Parameters
theIsNexttrue, if Tab(to the next widget) or false(moving to the previous)

◆ onAcceptData()

void XGUI_PropertyPanel::onAcceptData ( )
virtual

The method is called on accepting of operation.

Implements ModuleBase_IPropertyPanel.

◆ setInternalActiveWidget()

void XGUI_PropertyPanel::setInternalActiveWidget ( ModuleBase_ModelWidget theWidget)

Set internal active widget, that can be returned as active widget and participate in active selection filters/modes in application.

It emits signal about property panel activation or deactivation and updates selection filters/modes accordingly.

Parameters
theWidgeta widget control to store as internal active widget

◆ updateContentWidget

void XGUI_PropertyPanel::updateContentWidget ( FeaturePtr  theFeature)
slot

Update all widgets in property panel with values from the given feature.

Parameters
theFeaturea Feature to update values in widgets

◆ createContentPanel

void XGUI_PropertyPanel::createContentPanel ( FeaturePtr  theFeature)
slot

If the XML definition of the feature contains information about specific content of the property panel, it creates the panel and allow filling it by the given feature.

Parameters
theFeaturea Feature to fill property panel

◆ activateWidget

void XGUI_PropertyPanel::activateWidget ( ModuleBase_ModelWidget theWidget,
const bool  theEmitSignal = true 
)
virtualslot

Makes the given widget active, highlights it and removes highlighting from the previous active widget.

Parameters
theWidgetwhich has to be activated
theEmitSignala flag to prohibit signal emit

◆ onFocusInWidget

void XGUI_PropertyPanel::onFocusInWidget ( ModuleBase_ModelWidget theWidget)
slot

Activates the parameter widget if it can accept focus.

Parameters
theWidgeta widget where focus in event happened

◆ onActivateNextWidget

void XGUI_PropertyPanel::onActivateNextWidget ( ModuleBase_ModelWidget theWidget)
slot

Activate next widget.

Parameters
theWidgetthe current widget

◆ enterClicked

void XGUI_PropertyPanel::enterClicked ( QObject theObject)
signal

The signal is emitted if the enter is clicked in the control of the widget.

Parameters
theObjecta sender of the event

◆ propertyPanelDeactivated

void XGUI_PropertyPanel::propertyPanelDeactivated ( )
signal

Emits on deactivating property panel (e.g. by clearContent)

◆ propertyPanelActivated

void XGUI_PropertyPanel::propertyPanelActivated ( )
signal

Emits on widget activating.

◆ setActiveWidget()

bool XGUI_PropertyPanel::setActiveWidget ( ModuleBase_ModelWidget theWidget,
const bool  isEmitSignal 
)
protected

Makes the widget active, deactivate the previous, activate and hightlight the given one.

Parameters
theWidgeta widget
isEmitSignalflag whether panel signals should be emitted

◆ focusNextPrevChild()

bool XGUI_PropertyPanel::focusNextPrevChild ( bool  theIsNext)
protectedvirtual

The parent method that processes the "Tab"/"SHIF + Tab" keyboard events Emits a signal about focus change If theIsNext is true, this function searches forward, if next is false, it searches backward.

◆ activateNextWidget() [3/3]

void XGUI_PropertyPanel::activateNextWidget ( ModuleBase_ModelWidget theWidget,
const bool  isCheckVisibility 
)
protected

Activate the next widget in the property panel.

Parameters
theWidgeta widget. The next widget should be activated
isCheckVisibilityflag whether the next widget visibility is checked

◆ closeEvent()

void XGUI_PropertyPanel::closeEvent ( QCloseEvent *  theEvent)
protected

A method called on the property panel closed.

Parameters
theEventa close event

◆ modelWidget()

ModuleBase_ModelWidget * ModuleBase_IPropertyPanel::modelWidget ( const std::string &  theAttributeId) const
virtualinherited

Returns widget, that has the given attribute index.

Parameters
theAttributeIdan attribute from XML

◆ isEditingMode()

bool ModuleBase_IPropertyPanel::isEditingMode ( ) const
inlineinherited
Returns
State of editing mode flag

◆ findFirstAcceptingValueWidget() [1/2]

ModuleBase_ModelWidget * ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget ( )
inherited

Returns the first widget, where canAcceptFocus returns true.

Returns
a widget or null

◆ findFirstAcceptingValueWidget() [2/2]

ModuleBase_ModelWidget * ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget ( const QList< ModuleBase_ModelWidget * > &  theWidgets)
staticinherited

Returns the first widget, where canAcceptFocus returns true.

Returns
a widget or null

workaround for the same attributes used in different stacked widgets(attribute types)

◆ isModified()

bool ModuleBase_IPropertyPanel::isModified ( ) const
virtualinherited

Returns True if data of its feature was modified during operation.

◆ keyReleased

void ModuleBase_IPropertyPanel::keyReleased ( QObject theObject,
QKeyEvent *  theEvent 
)
signalinherited

The signal about key release on the control, that corresponds to the attribute.

Parameters
theObjecta sender of the event
theEventkey release event

◆ beforeWidgetActivated

void ModuleBase_IPropertyPanel::beforeWidgetActivated ( ModuleBase_ModelWidget theWidget)
signalinherited

The signal about the widget activation.

Parameters
theWidgetthe activated widget

◆ noMoreWidgets

void ModuleBase_IPropertyPanel::noMoreWidgets ( const std::string &  thePreviousAttributeID)
signalinherited

The signal about the widget activation.

Parameters
theWidgetthe activated widget Emited when there is no next widget
thePreviousAttributeIDan attribute key of the previous active widget

Field Documentation

◆ myIsEditing

bool ModuleBase_IPropertyPanel::myIsEditing
protectedinherited

Flag which shows that current operation is in editing mode.