[PyQt] API 2 and Qt Designer

Phil Thompson phil at riverbankcomputing.com
Tue Sep 28 11:25:36 BST 2010


On Tue, 28 Sep 2010 12:11:48 +0200, "Sybren A. Stüvel" <sybren at stuvel.eu>
wrote:
> On Tuesday 28 September 2010 12:03:25 Phil Thompson wrote:
>> > Is it possible to move to API 2 and still keep using Qt Designer?
>> 
>> Yes, because the code generated by pyuic4 works with both Python2
>> and Python3.
>> 
>> You have to make sure that you call setapi() before the very first
>> PyQt import.
> 
> I do that in my code. When I import my modules from outside Qt 
> Designer they load just fine.
> 
> It seems that Qt Designer already imports PyQt before importing my 
> plugin modules. When I start the designer with the PYQTDESIGNERPATH 
> environment variable set to my designer plugin directory, I get those 
> errors.

I didn't understand what you meant by "using Qt Designer".

Your only option at the moment is to use the Python plugin built against
Python3. This then means that your custom widgets would need to work with
Python3, but that shouldn't be too difficult if they are already ported to
the v2 APIs.

Phil


More information about the PyQt mailing list