Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkFileChooser.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkFileChooser_h_Included
14 #define QmitkFileChooser_h_Included
15 
17 #include <QWidget>
18 
19 class QPushButton;
20 class QLineEdit;
21 
29 {
30  Q_OBJECT
31 
32 public:
36  explicit QmitkFileChooser(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
37 
42  void SetHorizotalLayout(bool horizontalLayout);
47  void SetSelectDir(bool selectDir);
52  void SetFileMustExist(bool fileMustExist);
56  void SetFile(const std::string &file);
60  void SetFilePattern(const std::string &filepattern);
64  void SetReadOnly(bool ReadOnly);
68  bool IsValidFile() const;
72  virtual std::string GetFile() const;
73 
74 signals:
78  void NewFileSelected(const std::string &);
79 
80 protected slots:
84  virtual void OnSelectFileClicked(bool /*checked=false*/);
88  virtual void OnFileEditingFinished();
89 
90 protected:
99 
103  QString m_FilePattern;
107  QPushButton *m_SelectFile;
111  QLineEdit *m_File;
112 };
113 
114 #endif
QPushButton * m_SelectFile
#define MITKQTWIDGETSEXT_EXPORT
Convenience Widget showing a line edit with the path of a file or directory and a button which invoke...