How can I find syntax errors in QML files?
Asked Answered
F

3

7

I'm doing development for Blackberry 10 using Cascades, which includes QT and QML. I find that I sometimes make mistakes in my QML file, but they don't get picked up at compilation time. How can I check whether I've made a syntax error, or mis-named a function call, or other typical errors?

Fronniah answered 11/3, 2013 at 9:9 Comment(1)
Even an automated smoke-test at compile time would save me a lot of development turnaround time.Thresher
O
4

QML is a dynamic language that is evaluated at Runtime. There is no compilation step and due to the nature of javascript and the dynamic nature of the global context there is no way for it to tell if what you are writing is correct/incorrect until it is evaluated. QtCreator can help with some of the QML errors you will find, but there is unfortunately no good way to get syntax errors about your javascript until it is evaluated and it explodes.

Personally, I have found good usage of the debugger to be the key to making these sort of fixes easy.

tldr; Keep your javascript clean and to a minimum there is no compile time checking.

Oona answered 11/3, 2013 at 15:30 Comment(0)
B
0

open terminal in IDE connect your device or emulator using blackberry-SSH after connecting enter slog2info it show syntax and all typical error JavaScript with description and line NO.

Bedrail answered 31/3, 2013 at 18:9 Comment(1)
It the run-time way to check errors. But you check only paths your code use right now, not all parts of every file. The question was about compile-time, and the answer is: there's no way to check everything at compile-time.Glossary
S
0

If there are any mistakes it will show those lines in RED marks. It is dynamically checks there is no need to worry about compile. If you done wrong you will not see the DESIGN CONSOLE correctly.

Stets answered 26/8, 2013 at 11:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.