forked from qt-creator/qt-creator
Qml2Puppet: Replace a few deprecated QVariant::type() calls
... by typeId(). Change-Id: Ib617db774cec2c23ac58bcd39d99a59f9820f443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -374,7 +374,7 @@ void ObjectNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParentIn
|
|||||||
QVariant ObjectNodeInstance::convertSpecialCharacter(const QVariant& value) const
|
QVariant ObjectNodeInstance::convertSpecialCharacter(const QVariant& value) const
|
||||||
{
|
{
|
||||||
QVariant specialCharacterConvertedValue = value;
|
QVariant specialCharacterConvertedValue = value;
|
||||||
if (value.type() == QVariant::String) {
|
if (value.typeId() == QVariant::String) {
|
||||||
QString string = value.toString();
|
QString string = value.toString();
|
||||||
string.replace(QLatin1String("\\n"), QLatin1String("\n"));
|
string.replace(QLatin1String("\\n"), QLatin1String("\n"));
|
||||||
string.replace(QLatin1String("\\t"), QLatin1String("\t"));
|
string.replace(QLatin1String("\\t"), QLatin1String("\t"));
|
||||||
@@ -472,7 +472,7 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar
|
|||||||
|
|
||||||
|
|
||||||
QVariant oldValue = property.read();
|
QVariant oldValue = property.read();
|
||||||
if (oldValue.type() == QVariant::Url) {
|
if (oldValue.typeId() == QVariant::Url) {
|
||||||
QUrl url = oldValue.toUrl();
|
QUrl url = oldValue.toUrl();
|
||||||
QString path = url.toLocalFile();
|
QString path = url.toLocalFile();
|
||||||
if (QFileInfo::exists(path) && nodeInstanceServer() && !path.isEmpty())
|
if (QFileInfo::exists(path) && nodeInstanceServer() && !path.isEmpty())
|
||||||
@@ -489,7 +489,7 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar
|
|||||||
qDebug() << "ObjectNodeInstance.setPropertyVariant: Cannot be written: " << object() << name << adjustedValue;
|
qDebug() << "ObjectNodeInstance.setPropertyVariant: Cannot be written: " << object() << name << adjustedValue;
|
||||||
|
|
||||||
QVariant newValue = property.read();
|
QVariant newValue = property.read();
|
||||||
if (newValue.type() == QVariant::Url) {
|
if (newValue.typeId() == QVariant::Url) {
|
||||||
QUrl url = newValue.toUrl();
|
QUrl url = newValue.toUrl();
|
||||||
QString path = url.toLocalFile();
|
QString path = url.toLocalFile();
|
||||||
if (QFileInfo::exists(path) && nodeInstanceServer() && !path.isEmpty())
|
if (QFileInfo::exists(path) && nodeInstanceServer() && !path.isEmpty())
|
||||||
@@ -579,7 +579,7 @@ void ObjectNodeInstance::refreshProperty(const PropertyName &name)
|
|||||||
else
|
else
|
||||||
property.write(resetValue(name));
|
property.write(resetValue(name));
|
||||||
|
|
||||||
if (oldValue.type() == QVariant::Url) {
|
if (oldValue.typeId() == QVariant::Url) {
|
||||||
QByteArray key = oldValue.toUrl().toEncoded(QUrl::UrlFormattingOption(0x100));
|
QByteArray key = oldValue.toUrl().toEncoded(QUrl::UrlFormattingOption(0x100));
|
||||||
QString pixmapKey = QString::fromUtf8(key.constData(), key.size());
|
QString pixmapKey = QString::fromUtf8(key.constData(), key.size());
|
||||||
QPixmapCache::remove(pixmapKey);
|
QPixmapCache::remove(pixmapKey);
|
||||||
|
Reference in New Issue
Block a user