rbutilqt/themeeditor: Fix Qt6 deprecations
rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Mon, 29 Jun 2026 17:28:58 -0400
| Newsgroups | gmane.comp.systems.archos.rockbox.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit e3e416c51b1bc66b577ad3ba20006b9c0d611a2c Author: Vencislav Atanasov <[email protected]> Date: Mon Jun 29 22:13:09 2026 +0300 rbutilqt/themeeditor: Fix Qt6 deprecations - insertMulti() -> insert() - QString::fromUtf16() with a parameter type other than char16_t* - enterEvent() parameter type changed from QEvent to QEnterEvent - QVariant -> QMetaType Co-authored-by: ChatGPT (GPT-5.3 Mini) <[email protected]> Change-Id: Ia9c6c93e281475856e8355a8aa0e64c474eed80c diff --git a/utils/rbutilqt/base/system.cpp b/utils/rbutilqt/base/system.cpp index 7bd4f5006c..33de19f5d2 100644 --- a/utils/rbutilqt/base/system.cpp +++ b/utils/rbutilqt/base/system.cpp @@ -337,7 +337,7 @@ QMultiMap<uint32_t, QString> System::listUsbDevices(void) } if(id) { - usbids.insertMulti(id, name); + usbids.insert(id, name); LOG_INFO() << "USB:" << QString("0x%1").arg(id, 8, 16) << name; } diff --git a/utils/rbutilqt/base/utils.cpp b/utils/rbutilqt/base/utils.cpp index cfa3f45df0..ec860847d5 100644 --- a/utils/rbutilqt/base/utils.cpp +++ b/utils/rbutilqt/base/utils.cpp @@ -225,8 +225,10 @@ QString Utils::filesystemName(QString path) { if(volparms.vMServerAdr == 0) { if(bsd == (char*)volparms.vMDeviceID) { - name = QString::fromUtf16((const ushort*)volname.unicode, - (int)volname.length); + name = QString::fromUtf16( + reinterpret_cast<const char16_t*>(volname.unicode), + static_cast<int>(volname.length) + ); break; } } diff --git a/utils/rbutilqt/preview.cpp b/utils/rbutilqt/preview.cpp index 3d90753709..7de9cbee61 100644 --- a/utils/rbutilqt/preview.cpp +++ b/utils/rbutilqt/preview.cpp @@ -81,7 +81,7 @@ void PreviewLabel::mouseMoveEvent(QMouseEvent * event) hovertimer.start(); mousepos = event->globalPosition().toPoint(); } -void PreviewLabel::enterEvent(QEvent * event) +void PreviewLabel::enterEvent(QEnterEvent * event) { (void) event; hovertimer.start(); diff --git a/utils/rbutilqt/preview.h b/utils/rbutilqt/preview.h index 7462413f0a..a57854c0a8 100644 --- a/utils/rbutilqt/preview.h +++ b/utils/rbutilqt/preview.h @@ -60,7 +60,7 @@ public: void setText(QString text); private slots: void mouseMoveEvent(QMouseEvent * event); - void enterEvent(QEvent * event); + void enterEvent(QEnterEvent * event); void leaveEvent(QEvent * event); void timeout(); diff --git a/utils/themeeditor/gui/devicestate.cpp b/utils/themeeditor/gui/devicestate.cpp index 395e8b3721..4accb4b707 100644 --- a/utils/themeeditor/gui/devicestate.cpp +++ b/utils/themeeditor/gui/devicestate.cpp @@ -482,7 +482,7 @@ void DeviceState::setData(QString tag, QVariant data) break; case Combo: - if(data.typeId() == QVariant::String) + if(data.typeId() == QMetaType::QString) dynamic_cast<QComboBox*> (found.second)-> setCurrentIndex(dynamic_cast<QComboBox*> diff --git a/utils/themeeditor/models/parsetreemodel.cpp b/utils/themeeditor/models/parsetreemodel.cpp index 3c1446988a..cd5276f303 100644 --- a/utils/themeeditor/models/parsetreemodel.cpp +++ b/utils/themeeditor/models/parsetreemodel.cpp @@ -245,11 +245,14 @@ bool ParseTreeModel::setData(const QModelIndex &index, const QVariant &value, } else if(tolower(param->type_code) == 'i') { - if(!value.canConvert(QMetaType(QVariant::Int))) + bool ok = false; + int number = value.toInt(&ok); + + if (!ok) return false; param->type = skin_tag_parameter::INTEGER; - param->data.number = value.toInt(); + param->data.number = number; } else { diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp index 2489a3b985..a2377ddee9 100644 --- a/utils/themeeditor/models/parsetreenode.cpp +++ b/utils/themeeditor/models/parsetreenode.cpp @@ -1078,7 +1078,7 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional, child = val.toInt(); child = branches * child / 100; } - else if(val.typeId() == QVariant::Bool) + else if(val.typeId() == QMetaType::Bool) { /* Boolean values have to be reversed, because conditionals are * always of the form %?tag<true|false> @@ -1096,7 +1096,7 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional, else child = 1; } - else if(val.typeId() == QVariant::String) + else if(val.typeId() == QMetaType::QString) { if(val.toString().length() > 0) child = 0; @@ -1180,18 +1180,18 @@ void ParseTreeNode::modParam(QVariant value, int index) } else if(param) { - if(value.typeId() == QVariant::Double) + if(value.typeId() == QMetaType::Double) { param->type = skin_tag_parameter::DECIMAL; param->data.number = static_cast<int>(value.toDouble() * 10); } - else if(value.typeId() == QVariant::String) + else if(value.typeId() == QMetaType::QString) { param->type = skin_tag_parameter::STRING; free(param->data.text); param->data.text = strdup(value.toString().toStdString().c_str()); } - else if(value.typeId() == QVariant::Int) + else if(value.typeId() == QMetaType::Int) { param->type = skin_tag_parameter::INTEGER; param->data.number = value.toInt(); -- rockbox-cvs mailing list [email protected] https://lists.haxx.se/mailman/listinfo/rockbox-cvs