UN-GCPDS / qt-material

Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6
https://qt-material.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
2.22k stars 240 forks source link

QTextEdit' object has no attribute 'setMarkdown' #75

Open unique021203 opened 1 year ago

unique021203 commented 1 year ago

When running the 'examples' given, I encountered the problem of "'IQTextEdit' object has no attribute 'setMarkdown'''. After trying PyQt5==5.12 and 5.14, I still haven't solved it. But in Official Document, the 'setMarkdown' method of PyQt5.QtWidgets.QTextEdit is provieded. Finally, I changed the /examples/main_window.ui from <property name="markdown"> to <property name="text">, and it finally been running successfully.

I wanna know whether there are some problems with my PYQT version. If other people encounter the same problem, can we make changes in the examples so that more people can run the examples successfully?

gustavo-iniguez-goya commented 1 year ago

setMarkdown was added to Qt in v5.14: https://wiki.qt.io/New_Features_in_Qt_5.14 "Qt Widgets QTextEdit and QTextBrowser now support Markdown format (CommonMark and GitHub dialects) as an alternative to HTML. "

I haven't found the PyQt changelog, but I guess the solution here would be to use setHtml, unless this project requires 5.15 specifically.