mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -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) {
|
if(id) {
|
||||||
usbids.insertMulti(id, name);
|
usbids.insert(id, name);
|
||||||
LOG_INFO() << "USB:" << QString("0x%1").arg(id, 8, 16) << 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(volparms.vMServerAdr == 0) {
|
||||||
if(bsd == (char*)volparms.vMDeviceID) {
|
if(bsd == (char*)volparms.vMDeviceID) {
|
||||||
name = QString::fromUtf16((const ushort*)volname.unicode,
|
name = QString::fromUtf16(
|
||||||
(int)volname.length);
|
reinterpret_cast<const char16_t*>(volname.unicode),
|
||||||
|
static_cast<int>(volname.length)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ void PreviewLabel::mouseMoveEvent(QMouseEvent * event)
|
||||||
hovertimer.start();
|
hovertimer.start();
|
||||||
mousepos = event->globalPosition().toPoint();
|
mousepos = event->globalPosition().toPoint();
|
||||||
}
|
}
|
||||||
void PreviewLabel::enterEvent(QEvent * event)
|
void PreviewLabel::enterEvent(QEnterEvent * event)
|
||||||
{
|
{
|
||||||
(void) event;
|
(void) event;
|
||||||
hovertimer.start();
|
hovertimer.start();
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public:
|
||||||
void setText(QString text);
|
void setText(QString text);
|
||||||
private slots:
|
private slots:
|
||||||
void mouseMoveEvent(QMouseEvent * event);
|
void mouseMoveEvent(QMouseEvent * event);
|
||||||
void enterEvent(QEvent * event);
|
void enterEvent(QEnterEvent * event);
|
||||||
void leaveEvent(QEvent * event);
|
void leaveEvent(QEvent * event);
|
||||||
void timeout();
|
void timeout();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -482,7 +482,7 @@ void DeviceState::setData(QString tag, QVariant data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Combo:
|
case Combo:
|
||||||
if(data.typeId() == QVariant::String)
|
if(data.typeId() == QMetaType::QString)
|
||||||
dynamic_cast<QComboBox*>
|
dynamic_cast<QComboBox*>
|
||||||
(found.second)->
|
(found.second)->
|
||||||
setCurrentIndex(dynamic_cast<QComboBox*>
|
setCurrentIndex(dynamic_cast<QComboBox*>
|
||||||
|
|
|
||||||
|
|
@ -245,11 +245,14 @@ bool ParseTreeModel::setData(const QModelIndex &index, const QVariant &value,
|
||||||
}
|
}
|
||||||
else if(tolower(param->type_code) == 'i')
|
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;
|
return false;
|
||||||
|
|
||||||
param->type = skin_tag_parameter::INTEGER;
|
param->type = skin_tag_parameter::INTEGER;
|
||||||
param->data.number = value.toInt();
|
param->data.number = number;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1078,7 +1078,7 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
|
||||||
child = val.toInt();
|
child = val.toInt();
|
||||||
child = branches * child / 100;
|
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
|
/* Boolean values have to be reversed, because conditionals are
|
||||||
* always of the form %?tag<true|false>
|
* always of the form %?tag<true|false>
|
||||||
|
|
@ -1096,7 +1096,7 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
|
||||||
else
|
else
|
||||||
child = 1;
|
child = 1;
|
||||||
}
|
}
|
||||||
else if(val.typeId() == QVariant::String)
|
else if(val.typeId() == QMetaType::QString)
|
||||||
{
|
{
|
||||||
if(val.toString().length() > 0)
|
if(val.toString().length() > 0)
|
||||||
child = 0;
|
child = 0;
|
||||||
|
|
@ -1180,18 +1180,18 @@ void ParseTreeNode::modParam(QVariant value, int index)
|
||||||
}
|
}
|
||||||
else if(param)
|
else if(param)
|
||||||
{
|
{
|
||||||
if(value.typeId() == QVariant::Double)
|
if(value.typeId() == QMetaType::Double)
|
||||||
{
|
{
|
||||||
param->type = skin_tag_parameter::DECIMAL;
|
param->type = skin_tag_parameter::DECIMAL;
|
||||||
param->data.number = static_cast<int>(value.toDouble() * 10);
|
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;
|
param->type = skin_tag_parameter::STRING;
|
||||||
free(param->data.text);
|
free(param->data.text);
|
||||||
param->data.text = strdup(value.toString().toStdString().c_str());
|
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->type = skin_tag_parameter::INTEGER;
|
||||||
param->data.number = value.toInt();
|
param->data.number = value.toInt();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue