NorMIT-nav  22.09
An IGT application
cxFileWatcherWidget.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 
12 #ifndef CXFILEWATCHERWIDGET_H_
13 #define CXFILEWATCHERWIDGET_H_
14 
15 #include "cxResourceWidgetsExport.h"
16 
17 #include "cxBaseWidget.h"
18 #include "boost/shared_ptr.hpp"
19 
20 class QFileSystemWatcher;
21 class QFile;
22 
23 namespace cx
24 {
25 
35 class cxResourceWidgets_EXPORT FileWatcherWidget : public BaseWidget
36 {
37  Q_OBJECT
38 
39 public:
40  FileWatcherWidget(QWidget* parent, QString objectName, QString windowTitle);
41  virtual ~FileWatcherWidget();
42 
43 public slots:
44  virtual void previewFileSlot(const QString& absoluteFilePath) = 0;
45 
46 protected:
47  bool internalOpenNewFile(const QString absoluteFilePath);
48  void watchFile(bool on);
49 
50  QFileSystemWatcher* mFileSystemWatcher;
51  boost::shared_ptr<QFile> mCurrentFile;
52 };
53 
54 } /* namespace cx */
55 #endif /* CXFILEWATCHERWIDGET_H_ */
cxBaseWidget.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::BaseWidget
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
cx::FileWatcherWidget::mFileSystemWatcher
QFileSystemWatcher * mFileSystemWatcher
Definition: cxFileWatcherWidget.h:50
cx::FileWatcherWidget
Baseclass for widgets that should watch a file.
Definition: cxFileWatcherWidget.h:35
cx::FileWatcherWidget::mCurrentFile
boost::shared_ptr< QFile > mCurrentFile
Definition: cxFileWatcherWidget.h:51