mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-07-10 13:29:52 -04:00
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) <chatgpt@openai.com> Change-Id: Ia9c6c93e281475856e8355a8aa0e64c474eed80c
This commit is contained in:
parent
d618846a8f
commit
e3e416c51b
7 changed files with 18 additions and 13 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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*>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue