3dsmax python : hook pyqt widget to max UI

When doing createDialog with maxscript, the dialog stay on top of max, but medit, renderer etc goes on top of it. It isn’t ‘allways on top’ window.

How can I match this behavior with maxplus+pyqt ?
actually as soon as I click on max interface, my pyqt ui disappear behind max itself !!


app = QtGui.QApplication.instance()
if not app: app = QtGui.QApplication([])
window = Dialog()


with class Dialog(QtGui.QWidget):

dont know if this is also for max:

import sys
from PyQt4 import QtGui, QtCore

class mymainwindow(QtGui.QMainWindow):
def init(self):
QtGui.QMainWindow.init(self, None, QtCore.Qt.WindowStaysOnTopHint)

mywindow = mymainwindow()
mywindow.show()

but this will make sure that the window is always on top, even wehn opening another application

some more flags can be found here:
http://ftp.ics.uci.edu/pub/centos0/ics-custom-build/BUILD/PyQt-x11-gpl-4.7.2/examples/widgets/windowflags.py

Yes this is what I do for testing but not a solution. If I minimize max or show another window it’s still there

I’m trying parenting my widget to max window but can’t get how to.
maxWinHwd = MaxPlus.Core.GetWindowHandle() return a swig object that put error when parenting to.

[QUOTE=KiboOst;23030]Yes this is what I do for testing but not a solution. If I minimize max or show another window it’s still there

I’m trying parenting my widget to max window but can’t get how to.
maxWinHwd = MaxPlus.Core.GetWindowHandle() return a swig object that put error when parenting to.[/QUOTE]

You can convert that to a QObject which you can use as a parent.
sip.wrapinstance(long(maxWinHwd), QtCore.QObject)

[QUOTE=blaisebundle;23031]You can convert that to a QObject which you can use as a parent.
sip.wrapinstance(long(maxWinHwd), QtCore.QObject)[/QUOTE]

and how do I get SIP working correctly? I really don’t get it working.

God Bless, they fixed it in 2016 SP1:
AttachQWidgetToMax( qwidget, isModelessDlg=True ) does the job