[Maya-Python] some problem with PyQt setStyleSheet and QSql database connection

2012-01-24 Thread Panupat Chongstitwattana
Hi everyone. I currently run into 2 problems when trying to start my PyQt inside Maya 2010. 1. When I run the script, I sometimes get the error 'NoneType' object has no attribute 'setStyleSheet' When I re-run the same script again, the error goes away and the UI shows up with the stylesheet

Re: [Maya-Python] some problem with PyQt setStyleSheet and QSql database connection

2012-01-24 Thread David Moulder
If your in 2010 then the qApp may not exist yet hence the NoneType Error. see http://www.mail-archive.com/python_inside_maya@googlegroups.com/msg01852.html Not used Qt's database drivers as we have our own dll that handles our server and file db connections. -Dave On Tue, Jan 24, 2012 at

Re: [Maya-Python] some problem with PyQt setStyleSheet and QSql database connection

2012-01-24 Thread Panupat Chongstitwattana
it's a pumpthread thing? Interesting . . . I suppose there's no real way around it for 2010? About the database, I just ran into another issue. On Maya 2012, I can't create QSqlDatabase object. I can import the module, get lists of drivers and print it out. from PyQt4 import QtSql drivers =

Re: [Maya-Python] some problem with PyQt setStyleSheet and QSql database connection

2012-01-24 Thread Judah Baron
Yeah, it looks like it's a timing thing. That block of code you have is a set of instructions that maya runs through pretty quickly, but you are getting into some quasi-asynchronous behavior with the atApp. Also, it's been a while since we have used pumpThread (we monitor QEvents instead because