Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm working on a custom context that makes use of additional keys. I'm picking up those key presses using an eventFilter. But if "echo all commands" is turned and the script editor is open then the tool crashes. It seems to be caused by this bit of code. Looking at the docs it says that this function is "not thread safe" which is a likely culprit, but I'm not sure if there is an alternative way to approach this, since executingOnIdle doesn't give a result. Any ideas?
bool testContext::eventFilter(QObject * object, QEvent *event)
{
MStatus status;
// Check if the viewport is in-focus
MString activePanel = MGlobal::executeCommandStringResult("getPanel -withFocus",
false,
false,
&status
);
...
}
Solved! Go to Solution.