Port example away from deprecated QVariant API
Change-Id: I284610f216409b593d307b8076c8f638722929e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
e27390f8e1
commit
6ed83f82fe
@ -214,7 +214,7 @@ void SettingsTree::updateChildItems(QTreeWidgetItem *parent)
|
||||
if (value.userType() == QMetaType::UnknownType) {
|
||||
child->setText(1, "Invalid");
|
||||
} else {
|
||||
if (value.type() == QVariant::String) {
|
||||
if (value.typeId() == QMetaType::QString) {
|
||||
const QString stringValue = value.toString();
|
||||
if (m_typeChecker->boolExp.match(stringValue).hasMatch()) {
|
||||
value.setValue(stringValue.compare("true", Qt::CaseInsensitive) == 0);
|
||||
|
@ -333,7 +333,7 @@ class Q_CORE_EXPORT QVariant
|
||||
explicit QVariant(Type type)
|
||||
: QVariant(QMetaType(int(type)))
|
||||
{}
|
||||
QT_DEPRECATED_VERSION_X_6_0("Use metaType().")
|
||||
QT_DEPRECATED_VERSION_X_6_0("Use typeId() or metaType().")
|
||||
Type type() const
|
||||
{
|
||||
int type = d.typeId();
|
||||
|
Loading…
Reference in New Issue
Block a user