Skip to content

Instantly share code, notes, and snippets.

@paulwinex
Created July 9, 2020 11:50
Show Gist options
  • Save paulwinex/f557c124422633b03754278bcfb17ac3 to your computer and use it in GitHub Desktop.
Save paulwinex/f557c124422633b03754278bcfb17ac3 to your computer and use it in GitHub Desktop.
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from pymel.core import *
text = '''<h2>Title</h2>
Some text
<a href="https://google.com">Help</a>
'''
lb = QLabel(ui.PyUI('MayaWindow').asQtObject())
lb.setTextInteractionFlags(Qt.TextBrowserInteraction)
lb.setOpenExternalLinks(True)
lb.setMinimumWidth(500)
lb.setStyleSheet('''
QWidget{
background-color: #ffffdb;
color:black;
padding: 10px 10px 10px 10px;
}
''')
lb.setWindowFlags(Qt.ToolTip)
lb.setText(text.replace('\n', '<br>'))
lb.show()
# lb.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment