2 * ModuleBase_WidgetFileSelector.h
4 * Created on: Aug 28, 2014
8 #ifndef MODULEBASE_WIDGETFILESELECTOR_H_
9 #define MODULEBASE_WIDGETFILESELECTOR_H_
11 #include <ModuleBase.h>
12 #include <ModuleBase_ModelWidget.h>
16 #include <QStringList>
21 class MODULEBASE_EXPORT ModuleBase_WidgetFileSelector : public ModuleBase_ModelWidget
25 ModuleBase_WidgetFileSelector(QWidget* theParent,
26 const Config_WidgetAPI* theData,
27 const std::string& theParentId);
28 virtual ~ModuleBase_WidgetFileSelector();
30 /// Saves the internal parameters to the given feature
31 /// \param theObject a model feature to be changed
32 virtual bool storeValue() const;
34 virtual bool restoreValue();
36 /// Returns the internal parent wiget control, that can be shown anywhere
37 /// \returns the widget
38 QWidget* getControl() const;
40 /// Returns list of widget controls
41 /// \return a control list
42 virtual QList<QWidget*> getControls() const;
44 /// Returns true if a file on the current path in the line edit
45 /// exists and has supported format
46 bool isCurrentPathValid();
49 void onPathSelectionBtn();
53 QString formatsString() const;
54 QStringList getValidatorFormats() const;
57 QLineEdit* myPathField;
58 QWidget* myMainWidget;
61 QString myDefaultPath;
64 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */