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 specialCharacterConvertedValue = value;
|
||||
if (value.type() == QVariant::String) {
|
||||
if (value.typeId() == QVariant::String) {
|
||||
QString string = value.toString();
|
||||
string.replace(QLatin1String("\\n"), QLatin1String("\n"));
|
||||
string.replace(QLatin1String("\\t"), QLatin1String("\t"));
|
||||
@@ -472,7 +472,7 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar
|
||||
|
||||
|
||||
QVariant oldValue = property.read();
|
||||
if (oldValue.type() == QVariant::Url) {
|
||||
if (oldValue.typeId() == QVariant::Url) {
|
||||
QUrl url = oldValue.toUrl();
|
||||
QString path = url.toLocalFile();
|
||||
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;
|
||||
|
||||
QVariant newValue = property.read();
|
||||
if (newValue.type() == QVariant::Url) {
|
||||
if (newValue.typeId() == QVariant::Url) {
|
||||
QUrl url = newValue.toUrl();
|
||||
QString path = url.toLocalFile();
|
||||
if (QFileInfo::exists(path) && nodeInstanceServer() && !path.isEmpty())
|
||||
@@ -579,7 +579,7 @@ void ObjectNodeInstance::refreshProperty(const PropertyName &name)
|
||||
else
|
||||
property.write(resetValue(name));
|
||||
|
||||
if (oldValue.type() == QVariant::Url) {
|
||||
if (oldValue.typeId() == QVariant::Url) {
|
||||
QByteArray key = oldValue.toUrl().toEncoded(QUrl::UrlFormattingOption(0x100));
|
||||
QString pixmapKey = QString::fromUtf8(key.constData(), key.size());
|
||||
QPixmapCache::remove(pixmapKey);
|
||||
|
Reference in New Issue
Block a user