From 32b035472ce2cce2949e110edc8d97693ee5f37e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 8 Oct 2012 14:25:00 +0200 Subject: [PATCH] UiLoader: Map QLCDNumber::numDigits to QLCDNumber::digitCount'. QLCDNumber::numDigits was deprecated in Qt 4 and removed in Qt 5. Task-number: QTBUG-27462 Change-Id: I95e26e84cb589fd6fca74255d22bf806ea14d12e Reviewed-by: Jarek Kobus --- src/designer/src/components/formeditor/qdesigner_resource.cpp | 4 +++- src/designer/src/lib/uilib/abstractformbuilder.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp index 6007ba0..0a6a00e 100644 --- a/src/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp @@ -938,7 +938,9 @@ void QDesignerResource::applyProperties(QObject *o, const QList &p const DomPropertyList::const_iterator cend = properties.constEnd(); for (DomPropertyList::const_iterator it = properties.constBegin(); it != cend; ++it) { const DomProperty *p = *it; - const QString propertyName = p->attributeName(); + QString propertyName = p->attributeName(); + if (propertyName == QLatin1String("numDigits") && o->inherits("QLCDNumber")) // Deprecated in Qt 4, removed in Qt 5. + propertyName = QLatin1String("digitCount"); const int index = sheet->indexOf(propertyName); QVariant v; if (!readDomEnumerationValue(p, sheet, index, v)) diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp index e606c46..319059c 100644 --- a/src/designer/src/lib/uilib/abstractformbuilder.cpp +++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp @@ -968,7 +968,9 @@ void QAbstractFormBuilder::applyProperties(QObject *o, const QList for (DomPropertyList::const_iterator it = properties.constBegin(); it != cend; ++it) { const QVariant v = toVariant(o->metaObject(), *it); if (!v.isNull()) { - const QString attributeName = (*it)->attributeName(); + QString attributeName = (*it)->attributeName(); + if (attributeName == QLatin1String("numDigits") && o->inherits("QLCDNumber")) // Deprecated in Qt 4, removed in Qt 5. + attributeName = QLatin1String("digitCount"); if (!d->applyPropertyInternally(o, attributeName, v)) o->setProperty(attributeName.toUtf8(), v); } -- 2.7.4