Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.4.0 Beta1
-
7230508c3b (qt/qtdeclarative/dev) e9c2ccd8be (qt/qtdeclarative/6.4) e9c2ccd8be (qt/tqtc-qtdeclarative/6.4)
Description
I've QML code like this:
onClicked: { if (panelGrid.currentPageIndex === 0) { panelGrid.currentPageIndex = panelGrid.pages - 1 } else { panelGrid.currentPageIndex -= 1 } }
The first branch of the "if" is generated to:
// generate_Decrement
{
auto converted = QJSPrimitiveValue(r2_4);
r2_2 = --converted.toInteger();
}
Which turns to:
src/app/com/foo/ui/.rcc/qmlcache/foo_ui_pages/panel/PanelArea_qml.cpp: In lambda function: src/app/com/foo/ui/.rcc/qmlcache/foo_ui_pages/panel/PanelArea_qml.cpp:4246:29: error: lvalue required as decrement operand 4246 | r2_2 = --converted.toInteger(); | ~~~~~~~~~~~~~~~~~~~^~ ~~~~~~~~~~~~~~~~~~^~
There's a similar one with:
if (panelGrid.currentPageIndex === panelGrid.pages - 1) { panelGrid.currentPageIndex = 0 } else { panelGrid.currentPageIndex += 1 }
but the comparison turns to:
src/app/com/foo/ui/.rcc/qmlcache/foo_ui_pages/panel/PanelArea_qml.cpp: In lambda function: src/app/com/foo/ui/.rcc/qmlcache/foo_ui_pages/panel/PanelArea_qml.cpp:4473:28: error: lvalue required as decrement operand 4473 | r2_2 = --converted.toDouble(); | ~~~~~~~~~~~~~~~~~~^~
PanelGrid is a qml component where pages is
property alias pages: gridRepeater.model
and gridRepeater.model is a number
Repeater { id: gridRepeater model: 4
Attachments
Issue Links
- resulted in
-
QTBUG-104549 Optimize arithmetic operators in qmlsc some more
- Closed