Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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"
29class qSlicerRelativePathMapperPrivate;
30
31//---------------------------------------------------------------------------
47class 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)
58public:
64 qSlicerRelativePathMapper(QObject* targetObject, const QByteArray& propertyName, const QByteArray& signal);
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;
77public 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
83protected Q_SLOTS:
86
87Q_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
93protected:
94 QScopedPointer<qSlicerRelativePathMapperPrivate> d_ptr;
95
96private:
97 Q_DECLARE_PRIVATE(qSlicerRelativePathMapper);
98 Q_DISABLE_COPY(qSlicerRelativePathMapper);
99};
100
101#endif
QScopedPointer< qSlicerRelativePathMapperPrivate > d_ptr
void setPaths(const QStringList &path)
void pathsChanged(const QStringList &value)
QByteArray propertyName
This property contains the name of the object mapped property.
void setPath(const QString &path)
void setRelativePath(const QString &path)
qSlicerRelativePathMapper(QObject *targetObject, const QByteArray &propertyName, const QByteArray &signal)
void relativePathsChanged(const QStringList &value)
void setRelativePaths(const QStringList &paths)
QObject * targetObject() const
The mapped object (the mapper parent)
void pathChanged(const QString &value)
void relativePathChanged(const QString &value)