QGroundControl UI customization

There isn’t always one. In most cases if you find a class in there which ends in Controller then there is a cc file of the same name which help with the business logic end of things. There are a few cases in the latest code where some controls are backed by a C++ QQuickItem implementation. Those you just have to know about. You’ll see that thing like the properties they are using don’t seem to be in the qml code, hence they are in the C++ side. They will be named the same as the control name.

Is it possible to expose anything from QML to the C++ part? For example, if I could expose a button from one of those QML pages to “QGCApplication.h”, I could modify the any function in “QGCApplication.h” itself.

Search for Qt C++/QML integration. There are tons of Qt doc on how you can make Qml and C++ code interact with each other. There is nothing special about how QGC does this. It’s just regular Qt support.

I also noticed that the variables (ScreenTools.defaultFontPixelWidth etc.) used to indicate height/width of various items, keep changing across platforms (MacOS/Windows/Android and devices among them), probably because the pixel density is changing across these screens.
I’ve used the printScreenStats() function in ScreenTools.qml to check.

Is there a way we can make it standard across all screens (at least all laptops/computers)? Or is this a bug from Qt’s side because they can’t read the screen pixel density ratios properly, and that we have to manually adjust this?

The whole point of ScreenTools.defaultFontPixelWidth is that it is not the same on all platforms. This provides you with screen independent sizing. If you base the size of things on a fixed number of pixels you cannot create a UI that will work reasonable on all device screen sizes.

1 Like

请问问什么在stable_V4.0中没有mainwindowinner.qml文件呢

请问我想虚拟摇杆,在进软件的时候就在地图界面上显示请问要修改哪里呢?
开发环境:ubunt 18.04.4 LTS QT:QT Creator(4.10.2)QT(5.13.2)Android(jdk 1.8.0_91 sdk 26.1.1 ndk 19.2.5345600)QGCStable_V4.0这是我所使用的开发环境
关于摇杆我跟踪到GeneralSettings.qml下
FactCheckBox {
text: qsTr(“Virtual Joystick”)
visible: _virtualJoystick.visible
fact: _virtualJoystick
}
property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick
appsettings.cc:
SFACT(AppSettings, virtualJoystick)

请您简单介绍一下Fact属性的机制,看着有点懵。。。

In flightdisplayviewvideo.qml when I add asynchronous property to loader then rtsp videostreming is stopped any idea ?