diff options
| author | Mitch Curtis <mitch.curtis@qt.io> | 2024-05-21 14:37:30 +0800 |
|---|---|---|
| committer | Mitch Curtis <mitch.curtis@qt.io> | 2024-05-23 09:48:19 +0800 |
| commit | f09c20ae911d093a7dfa049043ab51b63a787366 (patch) | |
| tree | 884c5576e03f198aa36311cfec1e233ba2d315a2 /src/quick/doc/snippets | |
| parent | d074ceb9f66026675e5943d5fed250e2ec808496 (diff) | |
Improve font documentation
- Move snippets into a file so they are tested by tst_quick_examples.
- Add snippet that shows how to construct a standalone font, which is
useful for sharing fonts among Components, for example.
Pick-to: 6.5 6.7
Change-Id: I87ef72c601060b6874d727aa4800f254c62f3eaf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/doc/snippets')
| -rw-r--r-- | src/quick/doc/snippets/qml/font.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/quick/doc/snippets/qml/font.qml b/src/quick/doc/snippets/qml/font.qml new file mode 100644 index 0000000000..5f76d6fc30 --- /dev/null +++ b/src/quick/doc/snippets/qml/font.qml @@ -0,0 +1,22 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick + +Item { +//! [text] + Text { + font.family: "Helvetica" + font.pointSize: 13 + font.bold: true + } +//! [text] + +//! [structured-value-construction] + readonly property font myFont: ({ + family: "Helvetica", + pointSize: 13, + bold: true + }) +//! [structured-value-construction] +} |
