FieldEditor for file. More...
#include <FileFieldEditor.h>
Inheritance diagram for FileFieldEditor:
Collaboration diagram for FileFieldEditor:Public Member Functions | |
| void | copyToPath (QString path) |
| set the path to copy the selected file to | |
| FileFieldEditor (CamiTKExtensionModelPresenter *presenter, VariantDataModel &dataModel, const QString &name="", const QString &description="") | |
| Constructor. | |
| virtual QWidget * | getWidget () override |
| Build an editable QListWidget (where items can be added an removed) | |
| void | setFilter (QString filter) |
| set the file extension filter | |
Public Member Functions inherited from FieldEditor | |
| virtual void | appendRowTo (QGridLayout *layout, bool canBeDeleted=false) |
| Adds a row at the end of the given layout with two columns: | |
| FieldEditor (CamiTKExtensionModelPresenter *presenter, VariantDataModel &dataModel, const QString &name="", const QString &description="") | |
| Constructor Creates a field for the given data model inside the given presenter A name and description can be associated with the field (it will be used when the field is added to a gridlayout,. | |
| void | setEnabled (bool isEnabled) |
| Is the widget and labels currently enabled. | |
| virtual | ~FieldEditor () |
| Destructor (delete myWidget) | |
Additional Inherited Members | |
Signals inherited from FieldEditor | |
| void | valueChanged (VariantDataModel &changedDataModel) |
| emitted when the edited value has changed (useful to synchronize other field editor depending of this editor current value) | |
Protected Slots inherited from FieldEditor | |
| virtual void | deleteButtonClicked () |
| Called when the (optional) delete button is called This will make user the user knows what she/he does If deletion is confirmed by the user, remove the data model. | |
Protected Attributes inherited from FieldEditor | |
| VariantDataModel & | dataModel |
| The edited data model (part of the presenter's full model) | |
| QString | description |
| Description (displayed as tool tip / what's that) | |
| QGridLayout * | myGridLayout |
| where the widget is added | |
| QWidget * | myWidget |
| The created widget (inheriting must use this to create their widgets) | |
| QString | name |
| Name of the field (displayed as a label) | |
| CamiTKExtensionModelPresenter * | presenter |
| The presenter that contains the full VariantDataModel. | |
| QLabel * | rowLabel |
| the row label widget (that contains the name of the row) the label text can be modified (see CamiTKPropertyFieldEditor.h for an example) | |
FieldEditor for file.
Provides an QLineEdit with a button that open a file selection dialog to select an existing file.
Note: the default filter for file selection is for all supported pixmap. Call setFilter to give a list of filters.
Note: the selected file is left where it is, unless you call copyToPath to set a specific path. When a path is set, the selected file will be automatically copied to the specified path. (this is usefully to keep a local copy, i.e. for icons used in camitk extension files, but it can be awkward as you might end up with residual files in the specified path if the user modify the selected path!)
| FileFieldEditor::FileFieldEditor | ( | CamiTKExtensionModelPresenter * | presenter, |
| VariantDataModel & | dataModel, | ||
| const QString & | name = "", |
||
| const QString & | description = "" |
||
| ) |
Constructor.
| void FileFieldEditor::copyToPath | ( | QString | path | ) |
set the path to copy the selected file to
|
overridevirtual |
Build an editable QListWidget (where items can be added an removed)
Implements FieldEditor.
References FieldEditor::myWidget.
| void FileFieldEditor::setFilter | ( | QString | filter | ) |
set the file extension filter