*/
class MODULEBASE_EXPORT ModuleBase_WidgetFeatureOrAttribute : public ModuleBase_WidgetFeature
{
- Q_OBJECT
-public:
+Q_OBJECT
+ public:
/// Constructor
/// \theParent the parent object
/// \theParent the parent object
/// \theData the widget configuation. The attribute of the model widget is obtained from
- ModuleBase_WidgetFeatureOrAttribute(QWidget* theParent, const Config_WidgetAPI* theData, const std::string& theParentId);
+ ModuleBase_WidgetFeatureOrAttribute(QWidget* theParent, const Config_WidgetAPI* theData,
+ const std::string& theParentId);
/// Destructor
virtual ~ModuleBase_WidgetFeatureOrAttribute();
virtual bool storeValue() const;
virtual bool restoreValue();
+ /// Defines if it is supposed that the widget should interact with the viewer.
+ virtual bool isViewerSelector() { return true; }
+
+ protected:
+ /// Returns the feature attribute if it can be found by the given value
+ /// \param theValue the widget value
+ /// \return an attribute or null
+ std::shared_ptr<ModelAPI_Attribute> findAttribute(ModuleBase_WidgetValue* theValue);
-protected:
/// Set the attribute
/// \param theAttribute value
/// \return the boolean result of the attribute set
- bool setAttribute(const boost::shared_ptr<ModelAPI_Attribute>& theAttribute,
- bool theSendEvent = true);
+ bool setAttribute(const std::shared_ptr<ModelAPI_Attribute>& theAttribute, bool theSendEvent =
+ true);
-protected:
- boost::shared_ptr<ModelAPI_Attribute> myAttribute; /// < the attribute
+ protected:
+ std::shared_ptr<ModelAPI_Attribute> myAttribute; /// < the attribute
};
#endif