CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxMultiFileInputWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXMULTIFILEINPUTWIDGET_H_
12 #define CXMULTIFILEINPUTWIDGET_H_
13 
14 #include "cxResourceWidgetsExport.h"
15 
16 #include <QWidget>
17 class QLabel;
18 class QLineEdit;
19 class QTextEdit;
20 class QToolButton;
21 class QGridLayout;
22 class QAction;
23 
24 namespace cx
25 {
26 
35 class cxResourceWidgets_EXPORT MultiFileInputWidget : public QWidget
36 {
37  Q_OBJECT
38 public:
39  MultiFileInputWidget(QWidget* parent=0);
40 
41  void setDescription(QString text);
42  void setFilenames(QStringList text);
43 // void addFilename(QString text);
44  void setHelp(QString text);
45  void setBrowseHelp(QString text);
46  QStringList getFilenames() const;
47  QStringList getAbsoluteFilenames() const;
48  void setBasePath(QString path);
49  void setUseRelativePath(bool on);
50 
51 signals:
52  void fileChanged();
53 
54 private slots:
55  void browse();
56  void updateColor();
57  void evaluateTextChanges();
58 private:
59  void updateHelpInternal();
60  void widgetHasBeenChanged();
61  QStringList convertToAbsoluteFilenames(QStringList text) const;
62  QString convertToAbsoluteFilename(QString text) const;
63  QString convertFilenamesToTextEditText(QStringList files) const;
64  QString convertToPresentableFilename(QString text) const;
65 
66  QStringList mLastFilenames;
67  QString mBasePath;
68  bool mUseRelativePath;
69  QString mBaseHelp;
70 
71  QLabel* mDescription;
72  QTextEdit* mFilenameEdit;
73  QToolButton* mBrowseButton;
74  QGridLayout* mLayout;
75  QAction* mBrowseAction;
76 };
77 
78 } /* namespace cx */
79 #endif /* CXMULTIFILEINPUTWIDGET_H_ */
Namespace for all CustusX production code.