From: Friedemann Kleint Date: Mon, 8 Oct 2012 12:25:00 +0000 (+0200) Subject: UiLoader: Map QLCDNumber::numDigits to QLCDNumber::digitCount'. X-Git-Tag: accepted/tizen/20131212.181521~201 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32b035472ce2cce2949e110edc8d97693ee5f37e;p=platform%2Fupstream%2Fqttools.git 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 --- 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); }