1 Star 0 Fork 3

junzai1225/qgroundcontrol

forked from mavlink/qgroundcontrol 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CodingStyle.qml 2.57 KB
一键复制 编辑 原始数据 按行查看 历史
Don Gagne 提交于 2023-12-01 18:20 . Code changes for move to Qt6
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick
import QtQuick.Controls
import QGroundControl
import QGroundControl.ScreenTools
import QGroundControl.Controls
import QGroundControl.Palette
/// This is an example Qml file which is used to describe the QGroundControl coding style.
/// In general almost everything in here has some coding style meaning including order of
/// code. Not all style choices are explained. If there is any confusison please ask
/// and we'll answer and update style as needed.
Item {
// Property binding to item properties
width: ScreenTools.defaultFontPixelHeight * 10 // No hardcoded sizing. All sizing must be relative to a ScreenTools font size
height: ScreenTools.defaultFontPixelHeight * 20
// Property definitions available to consumers of this Qml Item come first
property int myIntProperty: 10
property real myRealProperty: 20.0
// Property definitions which are internal to the item are prepending with an underscore
// to signal private and come second
readonly property real _rectWidth: ScreenTools.defaultFontPixelWidth * 10 // Use readonly appropriately to increase binding performance
readonly property real _rectHeight: ScreenTools.defaultFontPixelWidth * 10
function myFunction() {
console.log("myFunction was called")
}
QGCPalette {
id: qgcPal // Note how id does not use an underscore
colorGroupEnabled: enabled
}
// You should always use the QGC provided variants of base control since they automatically support
// our theming and font support.
QGCButton {
// Also not how there is no id: specified for this control. Only add id: if it is needed.
text: "Button"
onClicked: myFunction()
}
Rectangle {
width: _rectWidth
height: _rectHeight
color: qgcPal.window // Use QGC palette colors for everything, no hardcoded colors
}
// For scoped blocks which are long include a comment so you can tell what the brace is matching.
// This is very handy when the top level brace scrolls off the screen. The endbrace comment in this
// specific file is only included as style info. This example code is not long enough to really need it.
} // Item - CodingStyle
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/junzai1225/qgroundcontrol.git
[email protected]:junzai1225/qgroundcontrol.git
junzai1225
qgroundcontrol
qgroundcontrol
master

搜索帮助