How to edit Maya's QT Palette - My attempts reset color when switching apps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All!
This is an unusual question and possibly I am approaching it wrong by trying to edit Maya qt style palette, but I would like to change all of maya's menu bar color to differentiate between multiple Mayas.
I've tried qt Stylesheets, They work to change Mayas menu bar colors, but unfortunately they mess up Maya's keyed attribute colors so you can't tell if somethings keyed or not in an attribute editor.
Next was Qt styles and palettes. But when I change the app palette (which would allow all future windows to inherit the change) The palette resets as soon as I click back into maya after leaving the app for something else.
from PySide import QtGui, QtCore from shiboken import wrapInstance import maya.OpenMayaUI as apiUI def getMayaWindow(): ptr = apiUI.MQtUtil.mainWindow() if ptr is not None: win = wrapInstance(long(ptr),QtGui.QWidget) return win maya_window = getMayaWindow() app = QtGui.QApplication app_palette = app.palette() MENU_COLOR = QtGui.QColor(50, 170,20) app_palette.setBrush(app_palette.Window, QtGui.QBrush(MENU_COLOR)) app_palette.setBrush(app_palette.Background, QtGui.QBrush(MENU_COLOR)) app.setPalette(app_palette, 'QMenuBar' )
I'm relatively new to QT, so I'm hoping I've just missed somethign fundimental that you can help me with.
I'm also open to the idea that there might be a way to change the palette when starting maya via command line.
Anyways. Let me know!
Thanks
Chad