--runtime warnings

This commit is contained in:
Aleix Pol 2014-07-11 19:51:42 +02:00
parent e008a5d7d4
commit 054a38b9d0

View File

@ -127,11 +127,15 @@ void TimeTracker::propertyChanged()
QMetaProperty prop = mo->property(i);
if (prop.notifySignalIndex() == senderSignalIndex()) {
QString val;
if (prop.type() < QVariant::UserType) {
QVariant var = prop.read(parent());
if(var.canConvert<QString>()) {
val = var.toString();
} else {
val = QString("<unknown %1>").arg(var.typeName());
}
}
if (val.isEmpty()) {
val = QString("<unknown %1>").arg(prop.typeName());
}
m_history.events.append(TimeEvent { QDateTime::currentDateTime(), QString("property %1 changed to %2").arg(prop.name()).arg(val)});
break;