|
|
|
# developer tools
|
|
|
|
|
|
|
|
## debugging QML javascript
|
|
|
|
|
|
|
|
Qt Creator as a qml debuger which is helpful to debug js.
|
|
|
|
|
|
|
|
* To enable this, vlc must be compiled with --enable-qt-qml-debug
|
|
|
|
|
|
|
|
* to start the debugger vlc must be started with something like:
|
|
|
|
--qt-qmljsdebugger=port:4242,block
|
|
|
|
|
|
|
|
* in qt creator "debug" > "start debugging" > "attach to QML port"
|
|
|
|
|
|
|
|
refer to [qt
|
|
|
|
documentation](https://doc.qt.io/qt-5/qtquick-debugging.html#starting-applications)
|
|
|
|
for more details
|
|
|
|
|
|
|
|
## QML caching
|
|
|
|
|
|
|
|
you can activate QML caching at compilation by passing the option
|
|
|
|
|
|
|
|
## inspecting QML objects live
|
|
|
|
|
|
|
|
there is a tool named GammaRay (https://github.com/KDAB/GammaRay/) which is
|
|
|
|
helpful to debug layout. It is dependent from the version of Qt, the best is
|
|
|
|
usually to compile it manually rather than using the version provided by your
|
|
|
|
distribution
|
|
|
|
|
|
|
|
# testing with software rendering
|
|
|
|
|
|
|
|
```export QT_QUICK_BACKEND=software```
|
|
|
|
|
|
|
|
# developer pitfalls
|
|
|
|
|
|
|
|
some common issue made by newcomer (everyone actually ^_^):
|
|
|
|
|
|
|
|
* beware of scaling issue, common sizes are defined in VLSStyle.qml and new ones
|
|
|
|
should be defined using dp() for proper scaling
|
|
|
|
|
|
|
|
* beware of translated strings, you should use `i18n.qtr` in qml and `qtr` in C++
|
|
|
|
|
|
|
|
* beware of theming colors, most colors are available in VLCStyle.colors. You
|
|
|
|
should test your code with light/dark/system theme.
|
|
|
|
|
|
|
|
* beware of the keyboard navigation system, don't break it.
|
|
|
|
|
|
|
|
# QML coding convention
|
|
|
|
|
|
|
|
As usual, the convention is to follow the convention used in the file you edit,
|
|
|
|
tough following guides are worth reading to have best practices in mind.
|
|
|
|
|
|
|
|
* https://doc.qt.io/qt-5/qml-codingconventions.html
|
|
|
|
|
|
|
|
* https://github.com/Furkanzmc/QML-Coding-Guide |