Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerRelativePathMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  https://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __qSlicerRelativePathMapper_h
22 #define __qSlicerRelativePathMapper_h
23 
24 // Qt includes
25 #include <QObject>
26 
27 // CTK includes
28 #include "qSlicerBaseQTCoreExport.h"
29 class qSlicerRelativePathMapperPrivate;
30 
31 //---------------------------------------------------------------------------
47 class Q_SLICER_BASE_QTCORE_EXPORT qSlicerRelativePathMapper : public QObject
48 {
49  Q_OBJECT
51  Q_PROPERTY(QByteArray propertyName READ propertyName)
52 
53  Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
54  Q_PROPERTY(QStringList paths READ paths WRITE setPaths NOTIFY pathsChanged)
55 
56  Q_PROPERTY(QString relativePath READ relativePath WRITE setRelativePath NOTIFY relativePathChanged STORED false)
57  Q_PROPERTY(QStringList relativePaths READ relativePaths WRITE setRelativePaths NOTIFY relativePathsChanged STORED false)
58 public:
64  qSlicerRelativePathMapper(QObject* targetObject, const QByteArray& propertyName, const QByteArray& signal);
65  virtual ~qSlicerRelativePathMapper();
66 
67  QByteArray propertyName()const;
68 
70  QObject* targetObject()const;
71 
72  QString path()const;
73  QStringList paths()const;
74 
75  QString relativePath()const;
76  QStringList relativePaths()const;
77 public Q_SLOTS:
78  void setPath(const QString& path);
79  void setPaths(const QStringList& path);
80  void setRelativePath(const QString& path);
81  void setRelativePaths(const QStringList& paths);
82 
83 protected Q_SLOTS:
84  void emitPathChanged();
85  void emitPathsChanged();
86 
87 Q_SIGNALS:
88  void pathChanged(const QString& value);
89  void pathsChanged(const QStringList& value);
90  void relativePathChanged(const QString& value);
91  void relativePathsChanged(const QStringList& value);
92 
93 protected:
94  QScopedPointer<qSlicerRelativePathMapperPrivate> d_ptr;
95 
96 private:
97  Q_DECLARE_PRIVATE(qSlicerRelativePathMapper);
98  Q_DISABLE_COPY(qSlicerRelativePathMapper);
99 };
100 
101 #endif