Medical Imaging Interaction Toolkit  2024.06.00
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
14 #define QmitkFileChooser_h
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 = {});
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
MITKQTWIDGETSEXT_EXPORT
#define MITKQTWIDGETSEXT_EXPORT
Definition: MitkQtWidgetsExtExports.h:15
QmitkFileChooser::m_FilePattern
QString m_FilePattern
Definition: QmitkFileChooser.h:103
QmitkFileChooser::m_File
QLineEdit * m_File
Definition: QmitkFileChooser.h:111
QmitkFileChooser::m_FileMustExist
bool m_FileMustExist
Definition: QmitkFileChooser.h:98
MitkQtWidgetsExtExports.h
QmitkFileChooser::m_SelectDir
bool m_SelectDir
Definition: QmitkFileChooser.h:94
QmitkFileChooser::m_SelectFile
QPushButton * m_SelectFile
Definition: QmitkFileChooser.h:107
QmitkFileChooser
Convenience Widget showing a line edit with the path of a file or directory and a button which invoke...
Definition: QmitkFileChooser.h:28