diff options
| author | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-02-23 01:34:10 -0700 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-02-27 23:33:13 -0700 |
| commit | d063437539d84c6c9d2a1fdde8184d19d2887395 (patch) | |
| tree | 4144ec57fbe837119981208aa34f6e1ec9ee01e2 /src/quick/doc/snippets/qml/textEditStatusSwitch.qml | |
| parent | c91ce0841cbb516f476819fe1c46dc0524abd6d3 (diff) | |
Add TextDocument.errorString property
In bec8df96b7615c6ce419867254027773ea7fd6b1 we added status and removed
the translated error string. But actually it's a common pattern to have
the error string available too, so as to avoid needing to generate it
from an enum value.
Also, in the textEditStatusSwitch.qml snippet, setting textFormat is
necessary after fdbacf2d5c0a04925bcb3aecd7bf47da5fb69227
Pick-to: 6.7
Change-Id: Ie880efa4bf347b70eb6cc4005283b1fc50e15508
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/doc/snippets/qml/textEditStatusSwitch.qml')
| -rw-r--r-- | src/quick/doc/snippets/qml/textEditStatusSwitch.qml | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/quick/doc/snippets/qml/textEditStatusSwitch.qml b/src/quick/doc/snippets/qml/textEditStatusSwitch.qml index d87e68f6cd..ad29220482 100644 --- a/src/quick/doc/snippets/qml/textEditStatusSwitch.qml +++ b/src/quick/doc/snippets/qml/textEditStatusSwitch.qml @@ -7,6 +7,7 @@ TextEdit { id: edit width: 300 height: 200 + textFormat: TextEdit.MarkdownText textDocument.source: "example.md" wrapMode: TextEdit.WordWrap @@ -22,12 +23,8 @@ TextEdit { return qsTr("Loading ") + edit.textDocument.source case TextDocument.Loaded: return qsTr("Loaded ") + edit.textDocument.source - case TextDocument.ReadError: - return qsTr("Failed to load ") + edit.textDocument.source - case TextDocument.NonLocalFileError: - return qsTr("Not a local file: ") + edit.textDocument.source default: - return "Unexpected status " + edit.textDocument.status + ": " + edit.textDocument.source + return edit.textDocument.errorString } } } |
