Revision b5d490c7
Von Christian Ehringfeld vor fast 9 Jahren hinzugefügt
src/entity.cpp | ||
---|---|---|
}
|
||
|
||
QString Entity::toString() const {
|
||
return this->getTablename() + ":" + QString::number(this->id);
|
||
QString r = "";
|
||
r.append(this->getClassname());
|
||
r.append(": {");
|
||
auto properties = this->getMetaProperties();
|
||
for (auto var = properties.constBegin(); var != properties.constEnd(); ++var) {
|
||
r.append(var.key() + ": " + var.value().read(this).toString() + ", ");
|
||
}
|
||
r.append("}");
|
||
return r;
|
||
}
|
||
|
||
Entity::~Entity() {
|
||
... | ... | |
return this->metaObject()->className();
|
||
}
|
||
|
||
QVariant Entity::property(const QString &name) const {
|
||
QVariant Entity::getProperty(const QString &name) const {
|
||
if (!name.isEmpty()) {
|
||
return QObject::property(name.toLatin1().constData());
|
||
}
|
||
return QVariant();
|
||
}
|
||
|
||
bool Entity::setProperty(const QString &name, const QVariant &value) {
|
||
return QObject::setProperty(name.toLatin1().constData(), value);
|
||
}
|
||
|
||
qint64 Entity::getId() const {
|
||
return id;
|
||
}
|
Auch abrufbar als: Unified diff
fix