Support Qt.TextFormat.MarkdownText in aqt.utils (#2675)

This commit is contained in:
Abdo 2023-09-23 07:04:25 +03:00 committed by GitHub
parent f78c59176e
commit 9d6e819701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,7 +81,7 @@ from aqt.qt import (
from aqt.theme import theme_manager
if TYPE_CHECKING:
TextFormat = Literal["plain", "rich"]
TextFormat = Literal["plain", "rich", "markdown"]
def aqt_data_path() -> Path:
@ -283,6 +283,8 @@ def showInfo(
mb.setTextFormat(Qt.TextFormat.PlainText)
elif textFormat == "rich":
mb.setTextFormat(Qt.TextFormat.RichText)
elif textFormat == "markdown":
mb.setTextFormat(Qt.TextFormat.MarkdownText)
elif textFormat is not None:
raise Exception("unexpected textFormat type")
mb.setText(text)