1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * ModuleBase_WidgetFileSelector.h
6 * Created on: Aug 28, 2014
10 #ifndef MODULEBASE_WIDGETFILESELECTOR_H_
11 #define MODULEBASE_WIDGETFILESELECTOR_H_
13 #include <ModuleBase.h>
14 #include <ModuleBase_ModelWidget.h>
18 #include <QStringList>
23 class MODULEBASE_EXPORT ModuleBase_WidgetFileSelector : public ModuleBase_ModelWidget
27 ModuleBase_WidgetFileSelector(QWidget* theParent,
28 const Config_WidgetAPI* theData,
29 const std::string& theParentId);
30 virtual ~ModuleBase_WidgetFileSelector();
32 /// Saves the internal parameters to the given feature
33 /// \param theObject a model feature to be changed
34 virtual bool storeValue() const;
36 virtual bool restoreValue();
38 /// Returns the internal parent wiget control, that can be shown anywhere
39 /// \returns the widget
40 QWidget* getControl() const;
42 /// Returns list of widget controls
43 /// \return a control list
44 virtual QList<QWidget*> getControls() const;
46 /// Returns true if a file on the current path in the line edit
47 /// exists and has supported format
48 bool isCurrentPathValid();
51 void onPathSelectionBtn();
55 QString formatsString() const;
56 QStringList getValidatorFormats() const;
59 QLineEdit* myPathField;
60 QWidget* myMainWidget;
63 QString myDefaultPath;
66 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */