From 340eebb13c0f39d73144d2ca5b5bda1003d0c178 Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Wed, 30 Aug 2023 16:01:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20property=20=E8=AF=AD?= =?UTF-8?q?=E6=B3=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- .../Environment/Qt/QML/QML_应用程序开发技术总结.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Software/Development/Environment/Qt/QML/QML_应用程序开发技术总结.md b/Software/Development/Environment/Qt/QML/QML_应用程序开发技术总结.md index a9f408b..000ddaf 100644 --- a/Software/Development/Environment/Qt/QML/QML_应用程序开发技术总结.md +++ b/Software/Development/Environment/Qt/QML/QML_应用程序开发技术总结.md @@ -78,6 +78,14 @@ QML 可以包含多个可显示对象,默认情况下 QML 文件中先写的 ## 2. 全局属性 +使用 property 关键字可以定义全局属性,该语法格式如下: + +```js +[default] [required] [readonly] property +``` + +属性名称必须以小写字母开头,并且只能包含字母、数字和下划线。 + ```js import QtQuick 2.12 import QtQuick.Window 2.12