添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Thank you for your response
I have change the QtWidgets.WindowStaysOnTopHint with QtCore.Qt

and now i have this error:

  # Error: TypeError: file <maya console> line 43: 'PySide2.QtWidgets.QDialog' called with wrong argument types:
      PySide2.QtWidgets.QDialog(PySide2.QtWidgets.QWidget, Shiboken.ObjectType)
    Supported signatures:
      PySide2.QtWidgets.QDialog(PySide2.QtWidgets.QWidget = NULL, PySide2.QtCore.Qt.WindowFlags = Qt.WindowFlags()) #

At first i did the QtCore.Qt and the above error appeared
and now i did the QtCore.Qt.WindowStaysOnTopHint

and i have this error:

# Error: AttributeError: file <maya console> line 43: type object 'PySide2.QtCore.Qt' has no attribute 'WindowStaysOnTopHint' #

So at least in my local install of PySide2 this very much exists: PySide2.QtCore.Qt.WindowStaysOnTopHint

You might try:
from PySide2.QtCore import Qt
and then use Qt.WindowStaysOnTopHint in that spot.

It seems like something else is at play then, because I don’t know how that would happen to you.

In a fresh session of Maya, does this work:

from PySide2.QtCore import Qt
print(Qt.WindowStaysOnTopHint)
              

But only these two lines you wrote are working.
The full script is executing correct, but when i am calling it with showUI()
i have the errors

I just checked and PySide2.QtCore.Qt.WindowType.Qt.WindowStaysOnTopHint does not exist. Unless this is explicitly written somewhere in the code…

As bob.w mentioned PySide2.QtCore.Qt.WindowStaysOnTopHint is the correct alias.

Make sure to include this import at the top of your script:

from PySide2 import QtCore

And give this a try:

class bSkinSaverUI(QtWidgets.QDialog):
    def __init__(self, parent=getMayaWindow()):
        super(bSkinSaverUI, self).__init__(parent=parent)
        self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)

Hello I test the solution the code looks with no errors, but when I run showUI() , send me a lot of errors :
this is one of many…
showUI()
Error: AttributeError: file line 101: ‘module’ object has no attribute ‘SIGNAL’