Re: [Maya-Python] Drawing/Adding QWidgets on top of Maya's Viewport

176 views
Skip to first unread message

Justin Israel

unread,
Mar 13, 2014, 12:52:21 AM3/13/14
to python_in...@googlegroups.com
There was a question like this a while back, and I think the conclusion was that it is a bit more complicated:




On Tue, Mar 11, 2014 at 6:39 AM, <grba...@hotmail.com> wrote:
Hello,

I am currently trying to add QWidgets on to Maya's viewport so that we can effectively divide it into regions (probably going to use QFrames for the actual QWidget) however I am running into an issue with creating them.  Whenever I create a widget on the viewport it's background is black and none of the methods that I have tried for making the widget's background transparent have done anything.  The basic test case that I have been using is:

import maya.OpenMayaUI as omui
from PySide import QtCore
from PySide import QtGui
from shiboken import wrapInstance

def maya_main_window():
    main_window_ptr = omui.MQtUtil.mainWindow()
    return wrapInstance(long(main_window_ptr), QtGui.QWidget)

def active_view():
    view = omui.M3dView.active3dView()
    return wrapInstance(long(view.widget()), QtGui.QWidget)

def add_QFrame():
    frame = QtGui.QFrame(parent = active_view())
    frame.setStyleSheet("background-color: transparent;");
    frame.show()
    return frame

if __name__ == "__main__":
    frame = add_QFrame()

In addition to setting the style sheet I have tried:
setAutoFillBackground(false);


Thank you very much

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1086d5c4-4194-4dfd-b69f-28d372046ba8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages