Tome
A generic data editor for games supporting arbitrary input and output formats.
filepickerwidget.h
1 #ifndef FILEPICKERWIDGET_H
2 #define FILEPICKERWIDGET_H
3 
4 #include <QHBoxLayout>
5 #include <QLineEdit>
6 #include <QPushButton>
7 #include <QVariant>
8 #include <QWidget>
9 
10 
11 namespace Tome
12 {
13  class FacetsController;
14  class ProjectController;
15 
19  class FilePickerWidget : public QWidget
20  {
21  Q_OBJECT
22 
23  public:
30  explicit FilePickerWidget(FacetsController& facetsController, ProjectController& projectController, QWidget* parent = 0);
32 
37  QVariant getFileName() const;
38 
43  void setFileName(const QVariant& fileName);
44 
49  void setFieldType(const QString& fieldType);
50 
51  private slots:
52  void onBrowseButtonClicked(bool checked);
53 
54  private:
55  FacetsController& facetsController;
56  ProjectController& projectController;
57 
58  QHBoxLayout* layout;
59 
60  QLineEdit* lineEdit;
61  QPushButton* button;
62 
63  QString fieldType;
64  };
65 }
66 
67 #endif // FILEPICKERWIDGET_H
Definition: commandlineoptions.h:6
QVariant getFileName() const
Gets the current file name.
Definition: filepickerwidget.cpp:50
Controller for validating type facets.
Definition: facetscontroller.h:16
Controller for creating, loading and saving projects.
Definition: projectcontroller.h:22
void setFieldType(const QString &fieldType)
Sets the type of the field to edit with this widget (e.g. custom type deriving from File)...
Definition: filepickerwidget.cpp:60
void setFileName(const QVariant &fileName)
Sets the current file name.
Definition: filepickerwidget.cpp:55
Widget that allows to browse for a file and shows the current path.
Definition: filepickerwidget.h:19
FilePickerWidget(FacetsController &facetsController, ProjectController &projectController, QWidget *parent=0)
Constructs a new widget that allows to browse for a file and shows the current path.
Definition: filepickerwidget.cpp:17