Wierd maya focus issue

Try this:

[ol]
[li]Open maya[/li][li]Open outliner[/li][li]Open Component Editor[/li][li]Select something in the outliner[/li][li]Click the component editor[/li][li]Hit the CTRL key[/li][li]Does your window focus go to the viewport?[/li][/ol]

Is this a maya thing or is this my issue?

ok so it “looks” like a maya 2013 issue. Just hitting CTRL will change the focus to whichever window the mouse is over

Sounds like a feature?

well the feature is playing havok with a pyqt window. Everytime an artist opens the window and goes to paste something, the focus goes back to the viewport. I guess maya doesnt look at these widgets the same.

It sounds like the popular hotkey accelerator “feature” from 3ds Max that required all sorts of ha- erm, “features”- to make .NET UI’s work with any hotkeys. Maybe the same with Maya and Qt?

See, Autodesk is sharing technology between its programs!

ok so to narrow this down here is what i find:

create a simple window with a TextEdit:

win = QtGui.QMainWindow(getMayaWindow())
centralwidget = QtGui.QWidget(win)
l = QtGui.QVBoxLayout(centralwidget)
t = QtGui.QPlainTextEdit(centralwidget)
l.addWidget(t)
win.setCentralWidget(centralwidget)
win.show()

*Do the thing that gets the maya window on line 1

open that and open the outliner.

  1. Click the outliner title bar, then click the textedit and paste something. This should work
  2. Click an object in the outliner, then click the textedit and paste something. This should focus the viewport and you’ll paste something into maya, not the text edit.

I’m not sure if this is something in the way i’m attaching to maya or even if this is going to be a solvable problem. Has anyone else noticed things like this?

Thanks

so i was able to fix the issue. I was already subclassing a PlainTextArea to convert tabs to spaces, so i captured the CTRL key and all is well. I’m not sure what disastrous side effects there are to capturing ctrl, but so far so good.

Does anyone know of a better way to do spaces instead of tabs in a QTextArea?