add setters
This commit is contained in:
parent
aa61cc14b9
commit
f1d1578554
35
path.cpp
35
path.cpp
@ -50,6 +50,41 @@ QList<Step> Path::getStep() const
|
||||
return step;
|
||||
}
|
||||
|
||||
void Path::setCity(const QString &newCity)
|
||||
{
|
||||
city = newCity;
|
||||
}
|
||||
|
||||
void Path::setDepartement(int newDepartement)
|
||||
{
|
||||
departement = newDepartement;
|
||||
}
|
||||
|
||||
void Path::setName(const QString &newName)
|
||||
{
|
||||
name = newName;
|
||||
}
|
||||
|
||||
void Path::setDifficulty(unsigned int newDifficulty)
|
||||
{
|
||||
difficulty = newDifficulty;
|
||||
}
|
||||
|
||||
void Path::setDuration(float newDuration)
|
||||
{
|
||||
duration = newDuration;
|
||||
}
|
||||
|
||||
void Path::setLength(float newLength)
|
||||
{
|
||||
length = newLength;
|
||||
}
|
||||
|
||||
void Path::setImage(const QString &newImage)
|
||||
{
|
||||
image = newImage;
|
||||
}
|
||||
|
||||
Path::Path(QFile *file){
|
||||
if (!file->open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Could not open file:" << file->errorString();
|
||||
|
||||
7
path.h
7
path.h
@ -29,6 +29,13 @@ public:
|
||||
float getLength() const;
|
||||
QString getImage() const;
|
||||
QList<Step> getStep() const;
|
||||
void setCity(const QString &newCity);
|
||||
void setDepartement(int newDepartement);
|
||||
void setName(const QString &newName);
|
||||
void setDifficulty(unsigned int newDifficulty);
|
||||
void setDuration(float newDuration);
|
||||
void setLength(float newLength);
|
||||
void setImage(const QString &newImage);
|
||||
};
|
||||
|
||||
#endif // PATH_H
|
||||
|
||||
10
step.cpp
10
step.cpp
@ -27,6 +27,16 @@ int Step::getResponse() const
|
||||
return response;
|
||||
}
|
||||
|
||||
void Step::setTitle(const QString &newTitle)
|
||||
{
|
||||
title = newTitle;
|
||||
}
|
||||
|
||||
void Step::setResponse(int newResponse)
|
||||
{
|
||||
response = newResponse;
|
||||
}
|
||||
|
||||
Step::Step() {
|
||||
latitude = 0.0;
|
||||
longitude = 0.0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user