qtdeclarative/examples/quickcontrols/texteditor
Shawn Rutledge 17a225f09a TextEditor example: allow setting multiple font attributes
When a user activates the boldAction for example, the code was replacing
QTextCharFormat's font with a default-constructed font that has the bold
attribute set, which meant that it could not be bold, italic, underlined
struck out, and with a custom size and color at the same time. On the
other hand, when we do it the current way:
  textArea.cursorSelection.font.bold = checked
we call QQuickTextSelection::font(), QFont::setBold(), and then
QQuickTextSelection::setFont(). (QFont is a QML value type, so it's the
only way.) Perhaps at some point, something was going wrong with that,
but it seems to work now.

Amends 045f9ce192

Fixes: QTBUG-136250
Pick-to: 6.8 6.9
Change-Id: I268e5814e7aa52aeb5aaec2d1a8fbfbc0d670236
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2025-04-29 21:08:27 +02:00
..
+touch Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
doc TextEditor example: add actions to built-in context menu, remove custom menu 2025-04-08 12:37:00 +08:00
fonts TextEdit example: Add more FontAwesome icons to fontello.ttf 2023-12-08 05:01:46 -07:00
images Gallery/Text editor: Update example logos 2023-03-27 08:22:16 +01:00
qml TextEditor example: allow setting multiple font attributes 2025-04-29 21:08:27 +02:00
CMakeLists.txt Examples: use qt_standard_project_setup in more places 2024-07-03 08:44:01 +02:00
creatorKateHighlighter.png Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
einstein.png Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
example.md Adjust Controls Text Editor example and docs further 2024-03-18 22:02:01 -07:00
red.png Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
texteditor.cpp Adjust Controls Text Editor example and docs further 2024-03-18 22:02:01 -07:00
texteditor.html Adjust Controls Text Editor example and docs further 2024-03-18 22:02:01 -07:00
texteditor.pro Controls TextEditor example: remove Qt.labs and the widget dependency 2023-12-15 02:28:09 -07:00
texteditor.qrc Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00