我想要一个超链接来在 QTextEdit 中启动邮件客户端。我尝试了此操作,但单击链接时没有任何反应:
self.text_area = QTextEdit()
self.text_area.setReadOnly(True)
self.text_area.setText(u'<p> Jhon Doe <a href='"'mailto:jhon@compay.com'"'>jhon@compay.com</a> </p>')
self.text_area.setTextInteractionFlags(Qt.LinksAccessibleByMouse)
Run Code Online (Sandbox Code Playgroud)