QScreen manual test: show names of enum values

It's more user-friendly to show
    primaryOrientation LandscapeOrientation
instead of
    primaryOrientation 2

Change-Id: Ic1659b9253cd492bef347d6840cf3cf6e6d2c94f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Alexander Volkov 2016-08-24 16:27:42 +03:00 committed by Shawn Rutledge
parent ca979a2f69
commit 3f64156e91

View File

@ -44,6 +44,9 @@ PropertyField::PropertyField(QObject* subject, const QMetaProperty& prop, QWidge
QString PropertyField::valueToString(QVariant val) QString PropertyField::valueToString(QVariant val)
{ {
if (m_prop.isEnumType())
return QString::fromUtf8(m_prop.enumerator().key(val.toInt()));
QString text; QString text;
switch (val.type()) { switch (val.type()) {
case QVariant::Double: case QVariant::Double: