I have the main window as a pyqt object and wanted to set the status
message using QMainWindow's statusBar(). Simple enough, right? Well, it
seems that QMainWindow.statusBar() expects the status bar to be a child of
the main window (directly) or it will create a new one - bummer. This is
kind of a problem since maya's status bar is buried buried way down in a
toolbar.
I found a workaround that works but I have to make some assumptions, so I'm
wondering if anyone else has a better solution. Here's what I'm doing:
# get main window as a pyqt widget
from PyQt4 import QtCore, QtGui
import maya.OpenMayaUI as mui
import sip
ptr = mui.MQtUtil.mainWindow()
mainWindow = sip.wrapinstance(long(ptr), QtCore.QObject)
# now I'm in pyqt land...
statusBar = mainWindow.findChild(QtGui.QStatusBar)
statusBar.setMessage('would you like to play a game?')
Anybody got a better solution?
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe