class QWidget;
class QLabel;
class QLineEdit;
+class QToolButton;
/**\class ModuleBase_WidgetFeature
* \ingroup GUI
*/
class MODULEBASE_EXPORT ModuleBase_WidgetFeature : public ModuleBase_ModelWidget
{
- 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_WidgetFeature(QWidget* theParent, const Config_WidgetAPI* theData);
+ ModuleBase_WidgetFeature(QWidget* theParent, const Config_WidgetAPI* theData,
+ const std::string& theParentId);
/// Destructor
virtual ~ModuleBase_WidgetFeature();
/// Saves the internal parameters to the given feature
/// \param theFeature a model feature to be changed
- virtual bool storeValue(ObjectPtr theObject) const;
+ virtual bool storeValue() const;
- virtual bool restoreValue(ObjectPtr theObject);
+ virtual bool restoreValue();
/// Returns the internal parent wiget control, that can be shown anywhere
/// \returns the widget
/// Returns list of widget controls
/// \return a control list
virtual QList<QWidget*> getControls() const;
+ /// Defines if it is supposed that the widget should interact with the viewer.
+ virtual bool isViewerSelector() { return true; }
-protected:
+ protected:
/// Fill the widget values by given point
/// \param thePoint the point
/// \return the boolean result of the feature set
- bool setFeature(const FeaturePtr& theObject);
+ bool setObject(const ObjectPtr& theObject, bool theSendEvent = true);
/// Returns current widget feature
/// \return the feature
- const FeaturePtr feature() const { return myFeature; }
+ const ObjectPtr object() const
+ {
+ return myObject;
+ }
/// Returns the widget editor
/// \return the editor
- QLineEdit* editor() const { return myEditor; }
+ QLineEdit* editor() const
+ {
+ return myEditor;
+ }
/// Returns the possible feature kinds
/// \return the list of kinds
- const QStringList& featureKinds() const { return myFeatureKinds; }
-
-private:
- FeaturePtr myFeature; ///< the current widget feature
- QStringList myFeatureKinds; ///< the kinds of possible features
-
- QWidget* myContainer; /// the parent top control
- QLabel* myLabel; /// the editor information label
- QLineEdit* myEditor; ///< the feature editor to visualize the feature name
+ const QStringList& featureKinds() const
+ {
+ return myObjectKinds;
+ }
+
+ protected:
+ ObjectPtr myObject; ///< the current widget feature
+ QStringList myObjectKinds; ///< the kinds of possible features
+
+ private:
+ QWidget* myContainer; /// the parent top control
+ QLabel* myLabel; /// the editor information label
+ QLineEdit* myEditor; ///< the feature editor to visualize the feature name
};
#endif