def setupWin(self):
self.setWindowTitle(self.name + " - v" + self.version + " - host: " + hostMode)
self.setWindowIcon(self.icon)
# initial win drag position
self.drag_position=QtGui.QCursor.pos()
self.setGeometry(500, 300, 250, 110) # self.resize(250,250)
#------------------------------
# template list: for frameless or always on top option
#------------------------------
# - template : keep ui always on top of all;
# While in Maya, dont set Maya as its parent
'''
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
'''
# - template: hide ui border frame;
# While in Maya, use QDialog instead, as QMainWindow will make it disappear
'''
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
'''
# - template: best solution for Maya QDialog without parent, for always on-Top frameless ui
'''
self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint)
'''
# - template: for transparent and non-regular shape ui
# note: use it if you set main ui to transparent, and want to use alpha png as irregular shape window
# note: black color better than white for better look of semi trans edge, like pre-mutiply
'''
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.setStyleSheet("background-color: rgba(0, 0, 0,0);")
'''
#############################################
# customized SUPER quick ui function for speed up programming
#############################################
universal_tool_template_0803.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录