diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-04 16:29:09 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-06 09:06:17 (GMT) |
commit | 633f3f45e5420663cf4ceadea79e62fea44cd2eb (patch) | |
tree | 1b2c0d8b5dc0746a51c2ea4bf542845273cf7006 /tools/designer/src/components/taskmenu/treewidgeteditor.cpp | |
parent | 7b5e37cab738804d47b78582aa3d0f3bb6933e70 (diff) | |
download | Qt-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/designer/src/components/taskmenu/treewidgeteditor.cpp')
-rw-r--r-- | tools/designer/src/components/taskmenu/treewidgeteditor.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/designer/src/components/taskmenu/treewidgeteditor.cpp b/tools/designer/src/components/taskmenu/treewidgeteditor.cpp index c4063d1..8fab2ad 100644 --- a/tools/designer/src/components/taskmenu/treewidgeteditor.cpp +++ b/tools/designer/src/components/taskmenu/treewidgeteditor.cpp @@ -171,8 +171,8 @@ void TreeWidgetEditor::setItemData(int role, const QVariant &v) BoolBlocker block(m_updatingBrowser); if (role == Qt::FontRole && newValue.type() == QVariant::Font) { QFont oldFont = ui.treeWidget->font(); - QFont newFont = qVariantValue<QFont>(newValue).resolve(oldFont); - newValue = qVariantFromValue(newFont); + QFont newFont = qvariant_cast<QFont>(newValue).resolve(oldFont); + newValue = QVariant::fromValue(newFont); ui.treeWidget->currentItem()->setData(col, role, QVariant()); // force the right font with the current resolve mask is set (item view bug) } ui.treeWidget->currentItem()->setData(col, role, newValue); @@ -198,7 +198,7 @@ void TreeWidgetEditor::on_newItemButton_clicked() newItem = new QTreeWidgetItem(ui.treeWidget); const QString newItemText = tr("New Item"); newItem->setText(0, newItemText); - newItem->setData(0, Qt::DisplayPropertyRole, qVariantFromValue(PropertySheetStringValue(newItemText))); + newItem->setData(0, Qt::DisplayPropertyRole, QVariant::fromValue(PropertySheetStringValue(newItemText))); newItem->setFlags(newItem->flags() | Qt::ItemIsEditable); ui.treeWidget->blockSignals(false); @@ -217,7 +217,7 @@ void TreeWidgetEditor::on_newSubItemButton_clicked() QTreeWidgetItem *newItem = new QTreeWidgetItem(curItem); const QString newItemText = tr("New Subitem"); newItem->setText(0, newItemText); - newItem->setData(0, Qt::DisplayPropertyRole, qVariantFromValue(PropertySheetStringValue(newItemText))); + newItem->setData(0, Qt::DisplayPropertyRole, QVariant::fromValue(PropertySheetStringValue(newItemText))); newItem->setFlags(newItem->flags() | Qt::ItemIsEditable); ui.treeWidget->blockSignals(false); @@ -408,10 +408,10 @@ void TreeWidgetEditor::on_treeWidget_itemChanged(QTreeWidgetItem *item, int colu if (m_updatingBrowser) return; - PropertySheetStringValue val = qVariantValue<PropertySheetStringValue>(item->data(column, Qt::DisplayPropertyRole)); + PropertySheetStringValue val = qvariant_cast<PropertySheetStringValue>(item->data(column, Qt::DisplayPropertyRole)); val.setValue(item->text(column)); BoolBlocker block(m_updatingBrowser); - item->setData(column, Qt::DisplayPropertyRole, qVariantFromValue(val)); + item->setData(column, Qt::DisplayPropertyRole, QVariant::fromValue(val)); updateBrowser(); } @@ -425,7 +425,7 @@ void TreeWidgetEditor::on_columnEditor_indexChanged(int idx) void TreeWidgetEditor::on_columnEditor_itemChanged(int idx, int role, const QVariant &v) { if (role == Qt::DisplayPropertyRole) - ui.treeWidget->headerItem()->setData(idx, Qt::EditRole, qVariantValue<PropertySheetStringValue>(v).value()); + ui.treeWidget->headerItem()->setData(idx, Qt::EditRole, qvariant_cast<PropertySheetStringValue>(v).value()); ui.treeWidget->headerItem()->setData(idx, role, v); } |