Hey All!

I've started toying with the idea of converting some apps from PyQt into PySide. So far so good (really appreciating the API compatibility right now). However I've run into some weirdness and I was wondering if anyone else has tried to use PySide /inside /maya or any other Qt based applications?

In a nutshell my problem is this.

/Outside of maya:/

x = PySide.QtGui.QApplication.instance()
print x
 <PySide.QtGui.QApplication object at 0x7f6dc8a06300>

x = PySide.QtGui.QApplication.instance()
print x
 <PySide.QtGui.QApplication object at 0x7f6dc8a06300>


/Inside maya:/

x = PySide.QtGui.QApplication.instance()

print x

<PySide.QtCore.QCoreApplication object at 0x1a69878>

x = PySide.QtGui.QApplication.instance()

print x

<PySide.QtCore.QCoreApplication object at 0x1a694e0>



Notice that the instance returned inside maya is different every time. PyQt4 doesn't exhibit this behaviour this is preventing me from making a simple transition to PySide. Any ideas on what part of the PySide implementation might be causing this? And is there a way to circumvent it?

In one particular example I'm attempting to emit a signal from the QApplication.instance() and it's resulting in a "C++ object has already been deleted" error:

QApplication.instance().emit(SIGNAL("xpStatusMessage(int)"), x)


I realise pyside offers a newer and cleaner syntax for emitting signals though I'm not sure how I would use it to emit a signal from an object I do not own.. in this case the QApplication instance.

Any thoughts? Cheers People

PySide-1.0.1 & QT 4.7

_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to