Hi,
I’m having trouble keeping my pyside2 window on top in Maya. Here’s the code:
from PySide2 import QtWidgets, QtUiTools, QtCore
import sys
class UI_Test(QtWidgets.QMainWindow):
def __init__(self, parent):
super(UI_Test, self).__init__(parent)
loader = QtUiTools.QUiLoader()
self.ui = loader.load('ui_file.ui')
self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
my_app = UI_Test(parent=QtWidgets.QApplication.activeWindow())
my_app.setWindowModality(QtCore.Qt.WindowModal)
my_app.ui.show()
I’ve done this successfully in the past but I’m not sure what’s wrong this time. Anything I’m missing here?
Thanks!