summaryrefslogtreecommitdiffstats
path: root/demos
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 /demos
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 'demos')
-rw-r--r--demos/browser/browserapplication.cpp4
-rw-r--r--demos/browser/cookiejar.cpp2
-rw-r--r--demos/browser/settings.cpp4
-rw-r--r--demos/embeddeddialogs/customproxy.cpp2
-rw-r--r--demos/interview/model.cpp2
-rw-r--r--demos/spectrum/app/settingsdialog.cpp8
-rw-r--r--demos/spreadsheet/spreadsheetitem.cpp6
7 files changed, 14 insertions, 14 deletions
diff --git a/demos/browser/browserapplication.cpp b/demos/browser/browserapplication.cpp
index ed95d32..633307c 100644
--- a/demos/browser/browserapplication.cpp
+++ b/demos/browser/browserapplication.cpp
@@ -231,14 +231,14 @@ void BrowserApplication::loadSettings()
QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont);
int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize);
QFont standardFont = QFont(standardFontFamily, standardFontSize);
- standardFont = qVariantValue<QFont>(settings.value(QLatin1String("standardFont"), standardFont));
+ standardFont = qvariant_cast<QFont>(settings.value(QLatin1String("standardFont"), standardFont));
defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family());
defaultSettings->setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize());
QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont);
int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize);
QFont fixedFont = QFont(fixedFontFamily, fixedFontSize);
- fixedFont = qVariantValue<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont));
+ fixedFont = qvariant_cast<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont));
defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family());
defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize());
diff --git a/demos/browser/cookiejar.cpp b/demos/browser/cookiejar.cpp
index 835b61b..d318e3a 100644
--- a/demos/browser/cookiejar.cpp
+++ b/demos/browser/cookiejar.cpp
@@ -186,7 +186,7 @@ void CookieJar::save()
if (cookies.at(i).isSessionCookie())
cookies.removeAt(i);
}
- cookieSettings.setValue(QLatin1String("cookies"), qVariantFromValue<QList<QNetworkCookie> >(cookies));
+ cookieSettings.setValue(QLatin1String("cookies"), QVariant::fromValue<QList<QNetworkCookie> >(cookies));
cookieSettings.beginGroup(QLatin1String("Exceptions"));
cookieSettings.setValue(QLatin1String("block"), m_exceptions_block);
cookieSettings.setValue(QLatin1String("allow"), m_exceptions_allow);
diff --git a/demos/browser/settings.cpp b/demos/browser/settings.cpp
index 5ceca67..d83e6a4 100644
--- a/demos/browser/settings.cpp
+++ b/demos/browser/settings.cpp
@@ -121,8 +121,8 @@ void SettingsDialog::loadFromSettings()
// Appearance
settings.beginGroup(QLatin1String("websettings"));
- fixedFont = qVariantValue<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont));
- standardFont = qVariantValue<QFont>(settings.value(QLatin1String("standardFont"), standardFont));
+ fixedFont = qvariant_cast<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont));
+ standardFont = qvariant_cast<QFont>(settings.value(QLatin1String("standardFont"), standardFont));
standardLabel->setText(QString(QLatin1String("%1 %2")).arg(standardFont.family()).arg(standardFont.pointSize()));
fixedLabel->setText(QString(QLatin1String("%1 %2")).arg(fixedFont.family()).arg(fixedFont.pointSize()));
diff --git a/demos/embeddeddialogs/customproxy.cpp b/demos/embeddeddialogs/customproxy.cpp
index bd56f5a..a715f5e 100644
--- a/demos/embeddeddialogs/customproxy.cpp
+++ b/demos/embeddeddialogs/customproxy.cpp
@@ -113,7 +113,7 @@ QVariant CustomProxy::itemChange(GraphicsItemChange change, const QVariant &valu
{
if (change == ItemChildAddedChange || change == ItemChildRemovedChange) {
if (change == ItemChildAddedChange) {
- currentPopup = qVariantValue<QGraphicsItem *>(value);
+ currentPopup = qvariant_cast<QGraphicsItem *>(value);
currentPopup->setCacheMode(ItemCoordinateCache);
if (scene())
currentPopup->installSceneEventFilter(this);
diff --git a/demos/interview/model.cpp b/demos/interview/model.cpp
index 840bc60..88f200d 100644
--- a/demos/interview/model.cpp
+++ b/demos/interview/model.cpp
@@ -109,7 +109,7 @@ QVariant Model::headerData(int section, Qt::Orientation orientation, int role) c
if (role == Qt::DisplayRole)
return QString::number(section);
if (role == Qt::DecorationRole)
- return qVariantFromValue(services);
+ return QVariant::fromValue(services);
return QAbstractItemModel::headerData(section, orientation, role);
}
diff --git a/demos/spectrum/app/settingsdialog.cpp b/demos/spectrum/app/settingsdialog.cpp
index b5e8459..1f125c9 100644
--- a/demos/spectrum/app/settingsdialog.cpp
+++ b/demos/spectrum/app/settingsdialog.cpp
@@ -65,13 +65,13 @@ SettingsDialog::SettingsDialog(
QAudioDeviceInfo device;
foreach (device, availableInputDevices)
m_inputDeviceComboBox->addItem(device.deviceName(),
- qVariantFromValue(device));
+ QVariant::fromValue(device));
foreach (device, availableOutputDevices)
m_outputDeviceComboBox->addItem(device.deviceName(),
- qVariantFromValue(device));
+ QVariant::fromValue(device));
- m_windowFunctionComboBox->addItem(tr("None"), qVariantFromValue(int(NoWindow)));
- m_windowFunctionComboBox->addItem("Hann", qVariantFromValue(int(HannWindow)));
+ m_windowFunctionComboBox->addItem(tr("None"), QVariant::fromValue(int(NoWindow)));
+ m_windowFunctionComboBox->addItem("Hann", QVariant::fromValue(int(HannWindow)));
m_windowFunctionComboBox->setCurrentIndex(m_windowFunction);
// Initialize default devices
diff --git a/demos/spreadsheet/spreadsheetitem.cpp b/demos/spreadsheet/spreadsheetitem.cpp
index e1f0143..93c82a0 100644
--- a/demos/spreadsheet/spreadsheetitem.cpp
+++ b/demos/spreadsheet/spreadsheetitem.cpp
@@ -72,10 +72,10 @@ QVariant SpreadSheetItem::data(int role) const
if (role == Qt::TextColorRole) {
if (!isNumber)
- return qVariantFromValue(QColor(Qt::black));
+ return QVariant::fromValue(QColor(Qt::black));
else if (number < 0)
- return qVariantFromValue(QColor(Qt::red));
- return qVariantFromValue(QColor(Qt::blue));
+ return QVariant::fromValue(QColor(Qt::red));
+ return QVariant::fromValue(QColor(Qt::blue));
}
if (role == Qt::TextAlignmentRole)