summaryrefslogtreecommitdiffstats
path: root/tools/linguist
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-04 16:29:09 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-06 09:06:17 (GMT)
commit633f3f45e5420663cf4ceadea79e62fea44cd2eb (patch)
tree1b2c0d8b5dc0746a51c2ea4bf542845273cf7006 /tools/linguist
parent7b5e37cab738804d47b78582aa3d0f3bb6933e70 (diff)
downloadQt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.zip
Qt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.tar.gz
Qt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.tar.bz2
Remove the use of deprecated qVariant*
Test directory untouched. This just apply those regexp: git grep -O"sed -i 's/qVariantValue</qvariant_cast</'" qVariantValue git grep -O"sed -i 's/qVariantSetValue(\([^&*\(),]*\), */\\1.setValue(/'" qVariantSetValue git grep -O"sed -i 's/qVariantSetValue *<\([^>]*\)> *(\([^&*\(),]*\), */\\2.setValue<\\1>(/'" qVariantSetValue git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*([^&*\(),]*)\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert git grep -O"sed -i 's/qVariantFromValue\( *[(<]\)/QVariant::fromValue\\1/'" qVariantFromValue git checkout src/corelib/kernal/qvariant* Rev-by: dev mailing list
Diffstat (limited to 'tools/linguist')
-rw-r--r--tools/linguist/linguist/formpreviewview.cpp14
-rw-r--r--tools/linguist/linguist/mainwindow.cpp2
-rw-r--r--tools/linguist/linguist/messagemodel.cpp12
3 files changed, 14 insertions, 14 deletions
diff --git a/tools/linguist/linguist/formpreviewview.cpp b/tools/linguist/linguist/formpreviewview.cpp
index f360a16..3f3f82a 100644
--- a/tools/linguist/linguist/formpreviewview.cpp
+++ b/tools/linguist/linguist/formpreviewview.cpp
@@ -83,7 +83,7 @@ static bool operator==(const QUiTranslatableStringValue &tsv1, const QUiTranslat
target.type = _type; \
target.target._target; \
target.prop._prop; \
- (*targets)[qVariantValue<QUiTranslatableStringValue>(_tsv)].append(target); \
+ (*targets)[qvariant_cast<QUiTranslatableStringValue>(_tsv)].append(target); \
} while (0)
static void registerTreeItem(QTreeWidgetItem *item, TargetsHash *targets)
@@ -350,14 +350,14 @@ static void highlightAction(QAction *a, bool on)
if (on) {
if (!bak.isValid()) {
QFont fnt = qApp->font();
- a->setProperty(FONT_BACKUP_PROP, qVariantFromValue(a->font().resolve(fnt)));
+ a->setProperty(FONT_BACKUP_PROP, QVariant::fromValue(a->font().resolve(fnt)));
fnt.setBold(true);
fnt.setItalic(true);
a->setFont(fnt);
}
} else {
if (bak.isValid()) {
- a->setFont(qVariantValue<QFont>(bak));
+ a->setFont(qvariant_cast<QFont>(bak));
a->setProperty(FONT_BACKUP_PROP, QVariant());
}
}
@@ -374,8 +374,8 @@ static void highlightWidget(QWidget *w, bool on)
foreach (QObject *co, w->children())
if (QWidget *cw = qobject_cast<QWidget *>(co))
cw->setPalette(cw->palette().resolve(pal));
- w->setProperty(PALETTE_BACKUP_PROP, qVariantFromValue(w->palette().resolve(pal)));
- w->setProperty(AUTOFILL_BACKUP_PROP, qVariantFromValue(w->autoFillBackground()));
+ w->setProperty(PALETTE_BACKUP_PROP, QVariant::fromValue(w->palette().resolve(pal)));
+ w->setProperty(AUTOFILL_BACKUP_PROP, QVariant::fromValue(w->autoFillBackground()));
QColor col1 = pal.color(QPalette::Dark);
QColor col2 = pal.color(QPalette::Light);
pal.setColor(QPalette::Base, col1);
@@ -390,8 +390,8 @@ static void highlightWidget(QWidget *w, bool on)
}
} else {
if (bak.isValid()) {
- w->setPalette(qVariantValue<QPalette>(bak));
- w->setAutoFillBackground(qVariantValue<bool>(w->property(AUTOFILL_BACKUP_PROP)));
+ w->setPalette(qvariant_cast<QPalette>(bak));
+ w->setAutoFillBackground(qvariant_cast<bool>(w->property(AUTOFILL_BACKUP_PROP)));
w->setProperty(PALETTE_BACKUP_PROP, QVariant());
w->setProperty(AUTOFILL_BACKUP_PROP, QVariant());
}
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 1611699..9072bab 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -184,7 +184,7 @@ private:
static const QVariant &pxObsolete()
{
static const QVariant v =
- qVariantFromValue(QPixmap(QLatin1String(":/images/s_check_obsolete.png")));
+ QVariant::fromValue(QPixmap(QLatin1String(":/images/s_check_obsolete.png")));
return v;
}
diff --git a/tools/linguist/linguist/messagemodel.cpp b/tools/linguist/linguist/messagemodel.cpp
index 39ba9fd..36202ab 100644
--- a/tools/linguist/linguist/messagemodel.cpp
+++ b/tools/linguist/linguist/messagemodel.cpp
@@ -1231,17 +1231,17 @@ int MessageModel::columnCount(const QModelIndex &) const
QVariant MessageModel::data(const QModelIndex &index, int role) const
{
static QVariant pxOn =
- qVariantFromValue(QPixmap(QLatin1String(":/images/s_check_on.png")));
+ QVariant::fromValue(QPixmap(QLatin1String(":/images/s_check_on.png")));
static QVariant pxOff =
- qVariantFromValue(QPixmap(QLatin1String(":/images/s_check_off.png")));
+ QVariant::fromValue(QPixmap(QLatin1String(":/images/s_check_off.png")));
static QVariant pxObsolete =
- qVariantFromValue(QPixmap(QLatin1String(":/images/s_check_obsolete.png")));
+ QVariant::fromValue(QPixmap(QLatin1String(":/images/s_check_obsolete.png")));
static QVariant pxDanger =
- qVariantFromValue(QPixmap(QLatin1String(":/images/s_check_danger.png")));
+ QVariant::fromValue(QPixmap(QLatin1String(":/images/s_check_danger.png")));
static QVariant pxWarning =
- qVariantFromValue(QPixmap(QLatin1String(":/images/s_check_warning.png")));
+ QVariant::fromValue(QPixmap(QLatin1String(":/images/s_check_warning.png")));
static QVariant pxEmpty =
- qVariantFromValue(QPixmap(QLatin1String(":/images/s_check_empty.png")));
+ QVariant::fromValue(QPixmap(QLatin1String(":/images/s_check_empty.png")));
int row = index.row();
int column = index.column() - 1;