QScreen manual test: fix conversion of enum values to names
Use the correct method of QMetaEnum to convert enum values to names. QMetaEnum::valueToKey() should be used, because it takes an enum value as an argument, while QMetaEnum::key() takes an index of the enum value. Change-Id: Ie895fcc935e8835e3d9c416ca34be8bfe82fd74e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
de7f281d7a
commit
095abb1925
@ -45,7 +45,7 @@ PropertyField::PropertyField(QObject* subject, const QMetaProperty& prop, QWidge
|
||||
QString PropertyField::valueToString(QVariant val)
|
||||
{
|
||||
if (m_prop.isEnumType())
|
||||
return QString::fromUtf8(m_prop.enumerator().key(val.toInt()));
|
||||
return QString::fromUtf8(m_prop.enumerator().valueToKey(val.toInt()));
|
||||
|
||||
QString text;
|
||||
switch (val.type()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user