forked from qt-creator/qt-creator
Replace qVariantValue() with qvariant_cast().
qVariantvalue() is deprecated in Qt 5. qvariant_cast() does the same thing and works in Qt 4 and Qt 5. Change-Id: I922329d3a47fe394669f5d97a25f0825d3d2dea5 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -142,7 +142,7 @@ void ShortcutSettings::commandChanged(QTreeWidgetItem *current)
|
||||
CommandMappings::commandChanged(current);
|
||||
if (!current || !current->data(0, Qt::UserRole).isValid())
|
||||
return;
|
||||
ShortcutItem *scitem = qVariantValue<ShortcutItem *>(current->data(0, Qt::UserRole));
|
||||
ShortcutItem *scitem = qvariant_cast<ShortcutItem *>(current->data(0, Qt::UserRole));
|
||||
setKeySequence(scitem->m_key);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ void ShortcutSettings::targetIdentifierChanged()
|
||||
{
|
||||
QTreeWidgetItem *current = commandList()->currentItem();
|
||||
if (current && current->data(0, Qt::UserRole).isValid()) {
|
||||
ShortcutItem *scitem = qVariantValue<ShortcutItem *>(current->data(0, Qt::UserRole));
|
||||
ShortcutItem *scitem = qvariant_cast<ShortcutItem *>(current->data(0, Qt::UserRole));
|
||||
scitem->m_key = QKeySequence(m_key[0], m_key[1], m_key[2], m_key[3]);
|
||||
if (scitem->m_cmd->defaultKeySequence() != scitem->m_key)
|
||||
setModified(current, true);
|
||||
@@ -176,7 +176,7 @@ void ShortcutSettings::resetTargetIdentifier()
|
||||
{
|
||||
QTreeWidgetItem *current = commandList()->currentItem();
|
||||
if (current && current->data(0, Qt::UserRole).isValid()) {
|
||||
ShortcutItem *scitem = qVariantValue<ShortcutItem *>(current->data(0, Qt::UserRole));
|
||||
ShortcutItem *scitem = qvariant_cast<ShortcutItem *>(current->data(0, Qt::UserRole));
|
||||
setKeySequence(scitem->m_cmd->defaultKeySequence());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1363,7 +1363,7 @@ void DocumentManager::executeOpenWithMenuAction(QAction *action)
|
||||
{
|
||||
QTC_ASSERT(action, return);
|
||||
const QVariant data = action->data();
|
||||
OpenWithEntry entry = qVariantValue<OpenWithEntry>(data);
|
||||
OpenWithEntry entry = qvariant_cast<OpenWithEntry>(data);
|
||||
if (entry.editorFactory) {
|
||||
// close any open editors that have this file open, but have a different type.
|
||||
EditorManager *em = EditorManager::instance();
|
||||
|
||||
Reference in New Issue
Block a user