Modifying the font.pixelSize of a TextEdit does not affect the code block.
-
wrote on 19 Jun 2024, 04:13 last edited by HsiaoPak
I'm using TextEdit to load Markdown, and when I modify the font.pixelSize, both the main text and headings are changing accordingly, but the font size of the code block remains the same.
-
May be sample code will help to help you. Post the sample code.
-
wrote on 19 Jun 2024, 06:36 last edited by
Hello,
When working with Markdown in TextEdit, adjusting font sizes for code blocks can be a bit tricky. Here are some approaches you can try: HTML Tags: To change the font size within Markdown cells, you can use the HTML <span> tag with the style attribute. Custom CSS (Advanced): If your Markdown renderer supports custom CSS (e.g., GitHub or certain Markdown editors), create a custom CSS rule to target code blocks.
I hope this info useful to you!...
Best Regard
Ford Benefits -
May be sample code will help to help you. Post the sample code.
wrote on 19 Jun 2024, 09:02 last edited byimport QtQuick 2.15 import QtQuick.Controls 2.15 TextEdit { id: textedit width: 600 height: 300 textFormat: TextEdit.MarkdownText Shortcut { sequence: "Ctrl+=" onActivated: { textedit.font.pixelSize += 1 } } text: "*Italic* **Bold** # Heading 1 ## Heading 2 body `code block` [Link](http://a.com) " }
Maybe you meant to replace "`" with "```". The size of the code block did not increase.
1/4