Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QmitkFileChooser_h_Included
18 #define QmitkFileChooser_h_Included
19 
21 #include <QWidget>
22 
23 class QPushButton;
24 class QLineEdit;
25 
33 {
34  Q_OBJECT
35 
36 public:
40  explicit QmitkFileChooser(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
41 
46  void SetHorizotalLayout(bool horizontalLayout);
51  void SetSelectDir(bool selectDir);
56  void SetFileMustExist(bool fileMustExist);
60  void SetFile(const std::string &file);
64  void SetFilePattern(const std::string &filepattern);
68  void SetReadOnly(bool ReadOnly);
72  bool IsValidFile() const;
76  virtual std::string GetFile() const;
77 
78 signals:
82  void NewFileSelected(const std::string &);
83 
84 protected slots:
88  virtual void OnSelectFileClicked(bool /*checked=false*/);
92  virtual void OnFileEditingFinished();
93 
94 protected:
103 
107  QString m_FilePattern;
111  QPushButton *m_SelectFile;
115  QLineEdit *m_File;
116 };
117 
118 #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...