A
A
Antony2015-04-11 12:25:19
Qt
Antony, 2015-04-11 12:25:19

How to change element ID in QML?

Actually standard IDs like text1, text2, text3 are not informative at all, and therefore useless. How to rename them - if I do it through the Designer - it writes "incorrect ID" and does not allow editing, if I edit in the code - it also swears and underlines in red.
Those. this code is correct:

Text {
            id: text1
            x: 163
            y: 8
            width: 70
            height: 65
            text: qsTr("Раз-два-три")
            font.pixelSize: 20
        }

But this one isn't:
Text {
            id: CustomText
            x: 163
            y: 8
            width: 70
            height: 65
            text: qsTr("Раз-два-три")
            font.pixelSize: 20
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Antony, 2015-04-11
@RiseOfDeath

Everything turned out to be simple. Turns out the first character can't be a capital letter (idiocy!)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question