refs #437 Removed toQVariant and convertFromQVariant.

This commit is contained in:
Mathew Sutcliffe
2015-05-31 17:21:17 +01:00
parent db5181c26a
commit 47cac09e81
10 changed files with 12 additions and 61 deletions

View File

@@ -46,10 +46,10 @@ namespace BlackGui
Q_ASSERT_X(this->getIContextSettings(), Q_FUNC_INFO, "missing settings");
// set values
ui->cb_Plugins->addItem(tr("Auto"), CSimulatorPluginInfo().toQVariant());
ui->cb_Plugins->addItem(tr("Auto"), QVariant::fromValue(CSimulatorPluginInfo()));
for (const auto &p : getIContextSimulator()->getAvailableSimulatorPlugins())
{
ui->cb_Plugins->addItem(p.toQString(), p.toQVariant());
ui->cb_Plugins->addItem(p.toQString(), QVariant::fromValue(p));
}
// connects

View File

@@ -120,7 +120,7 @@ namespace BlackGui
// otherwise (comboboxes) standard handling via QItemDelegate
CKeyboardLineEdit *lineEdit = qobject_cast<CKeyboardLineEdit *>(editor);
if (lineEdit)
model->setData(index, lineEdit->getKey().toQVariant() , Qt::EditRole);
model->setData(index, QVariant::fromValue(lineEdit->getKey()) , Qt::EditRole);
else
QItemDelegate::setModelData(editor, model, index);
}

View File

@@ -150,7 +150,7 @@ namespace BlackGui
//! Formatted data
ObjectType obj = this->getContainerOrFilteredContainer()[index.row()];
BlackMisc::CPropertyIndex propertyIndex = this->columnToPropertyIndex(index.column());
return formatter->data(role, obj.propertyByIndex(propertyIndex)).toQVariant();
return formatter->data(role, obj.propertyByIndex(propertyIndex)).getQVariant();
}
template <typename ObjectType, typename ContainerType>