Using PyQT with QT Designer

Dave Angel davea at davea.name
Fri Aug 23 16:16:59 EDT 2013


Michael Staggs wrote:


>
> That's the problem though. It is exactly how I want it in designer. It's
> perfect as it is in designer when I preview it. Here is a screenshot of the
> preview: http://i.imgur.com/ULRolq8.png
>
> The problem isn't that I can't design it in QT Designer. It is designed
> just like I want it. The problem is, when I try to follow zetcode and other
> tutorials about how to import and use my form as designed by qt designer
> and run through pyuic4.... it doesn't seem to even notice my ui file...and
> certainly isnt acting on it.
>

I don't know PyQT, so I've kept quiet so far...

You don't say what the name of the generated file is, but perhaps since
the source file was window.ui, the generated one is window.py

My guess is that when you do the

from window import Ui_MainWindow

it is finding some OTHER window.py file.

Have you tried simply adding an illegal line to the generated file, to
force the compiler to fail the import?  Once you're sure that it is
importing this particular file, you can remove such a line.

Could be that you have some other window.py file  (or window.pyc, or
whatever) and that it's finding that one.  Or it's finding some older
version of this one.



-- 
DaveA





More information about the Python-list mailing list