Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
FileFieldEditor.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6 *
7 * Visit http://camitk.imag.fr for more information
8 *
9 * This file is part of CamiTK.
10 *
11 * CamiTK is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * CamiTK is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * $CAMITK_LICENCE_END$
24 ****************************************************************************/
25
26
27#ifndef __FILE_FIELD_EDITOR__
28#define __FILE_FIELD_EDITOR__
29
30#include "FieldEditor.h"
31
48 Q_OBJECT
49public:
52
54 void setFilter(QString filter);
55
57 void copyToPath(QString path);
58
60 virtual QWidget* getWidget() override;
61
62private slots:
63 void chooseFile();
64
65private:
66 // filter to use for the file dialog (default = images)
67 QString filter;
68
69 // path to copy to (default is null string, meaning do not copy)
70 QString path;
71
72 // the line edit showing the file name (read only)
73 QLineEdit* lineEdit;
74
75 // list of file format supported by QImageReader
76 QString getDefaultImageFilter();
77};
78
79
80#endif // __FILE_FIELD_EDITOR__
Presenter for a CamiTK extension file model.
Definition CamiTKExtensionModelPresenter.h:47
Abstract class for field editor.
Definition FieldEditor.h:51
QString name
Name of the field (displayed as a label)
Definition FieldEditor.h:92
QString description
Description (displayed as tool tip / what's that)
Definition FieldEditor.h:95
CamiTKExtensionModelPresenter * presenter
The presenter that contains the full VariantDataModel.
Definition FieldEditor.h:83
VariantDataModel & dataModel
The edited data model (part of the presenter's full model)
Definition FieldEditor.h:86
FieldEditor for file.
Definition FileFieldEditor.h:47
void setFilter(QString filter)
set the file extension filter
Definition FileFieldEditor.cpp:99
virtual QWidget * getWidget() override
Build an editable QListWidget (where items can be added an removed)
Definition FileFieldEditor.cpp:42
void copyToPath(QString path)
set the path to copy the selected file to
Definition FileFieldEditor.cpp:104
VariantDataModel encapsulates QVariant and can be used as a model for any type of QVariant supported ...
Definition VariantDataModel.h:124