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;
|
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){
|
Path::Path(QFile *file){
|
||||||
if (!file->open(QIODevice::ReadOnly)) {
|
if (!file->open(QIODevice::ReadOnly)) {
|
||||||
qWarning() << "Could not open file:" << file->errorString();
|
qWarning() << "Could not open file:" << file->errorString();
|
||||||
|
|||||||
7
path.h
7
path.h
@ -29,6 +29,13 @@ public:
|
|||||||
float getLength() const;
|
float getLength() const;
|
||||||
QString getImage() const;
|
QString getImage() const;
|
||||||
QList<Step> getStep() 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
|
#endif // PATH_H
|
||||||
|
|||||||
10
step.cpp
10
step.cpp
@ -27,6 +27,16 @@ int Step::getResponse() const
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Step::setTitle(const QString &newTitle)
|
||||||
|
{
|
||||||
|
title = newTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Step::setResponse(int newResponse)
|
||||||
|
{
|
||||||
|
response = newResponse;
|
||||||
|
}
|
||||||
|
|
||||||
Step::Step() {
|
Step::Step() {
|
||||||
latitude = 0.0;
|
latitude = 0.0;
|
||||||
longitude = 0.0;
|
longitude = 0.0;
|
||||||
|
|||||||
2
step.h
2
step.h
@ -28,6 +28,8 @@ public:
|
|||||||
int getResponse() const;
|
int getResponse() const;
|
||||||
QList<QString> getPersonnage() const;
|
QList<QString> getPersonnage() const;
|
||||||
QList<QString> getTexte() const;
|
QList<QString> getTexte() const;
|
||||||
|
void setTitle(const QString &newTitle);
|
||||||
|
void setResponse(int newResponse);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STEP_H
|
#endif // STEP_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user