---
title: "解决在eric4中无法生成对话框代码问题"
author: "hellocgc"
date: "2011-01-03T17:18:38Z"
tags: []
categories: ["编程语言"]
slug: "eric4"
draft: false
lastmod: "2011-01-03T17:18:38Z"
id: 858115
url: "https://hellocgc.iteye.com/blog/858115"
---

On Mittwoch, 29. Dezember 2010, Youssef Oualmakran wrote:  
&gt; Dear sir or madame,  
&gt;  
&gt; I am trying to lean pyQt and Eric5 with the tutorial from Eric5 website.  
&gt;  
&gt;  
&gt; I get an "uic **error**" while trying to hit "**Generate** **dialog** **code** ...".  
&gt; The **error** text tells:  
&gt; "There was an **error** loading the form C:\\Users\[...]  
&gt; 'module' object has no attribute 'StackedWidget'".

That is an issue of the latest PyQt4. See PyQt mailing list for a patch. Here  
is the quote from the article:

To fix this issue, just open  
"/usr/lib/python2.7/site-packages/PyQt4/uic/uiparser.py", move to line  
161 and replace "QtGui.StackedWidget" with "QtGui.QStackedWidget".

Regards,  
Detlev

&gt;  
&gt; Then, I click "Ok" on the **error** window. On the window that appears  
&gt; "Forms **code** generator", when I click "new", I get a similar **error**.  
&gt;  
&gt;  
&gt; I have followed the instructions on  
&gt; [http://ericide.pythonprojects.org/tutorials/MiniBrowser/index.html](http://www.kickonline.info/browse.php?u=ZmM4ZWYxODNmZGZhOTU1YTdlMWY5Zjg1MmE5OWY0ZTkyZmY4ZjYxOTMxNjc5NmE5YzY0ZmU0NzRhMzdjYWVlZDc0YzA5ODFjN2VmMmE1MjZkMGQ3YWE2ZjE5M2Q4NWYzNDMyMjI5YTI0ZDk5ZDdlMWIwYWZhMDc3M2M4OA%3D%3D&amp%3Bb=1) and  
&gt; get this **error** when I am at chapter 3.  
&gt;  
&gt;  
&gt; I think I am using latest versions of the required softwarse:  
&gt;  
&gt; **Eric** 5.0.4  
&gt;  
&gt; Windows Seven Home Premium on a Pentium Dual Core  
&gt; Python Version: 3.1.3  
&gt; Found PyQt  
&gt; Found QScintilla2  
&gt; Qt Version: 4.7.1  
&gt; PyQt Version:  4.8.2  
&gt; QScintilla Version:  2.4.6  
&gt;  
&gt; Can someone tell me what that **error** means?  
&gt;  
&gt; Regards,  
&gt; Youssef Oualmakran  
&gt; \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\__  
&gt; **Eric** mailing list  
&gt; **Eric**@riverbankcomputing.com  
&gt; [http://www.riverbankcomputing.com/mailman/listinfo/**eric**](http://www.kickonline.info/browse.php?u=ZmM4ZWYxOTFmOGU0ZDg0MTczMGNkNDg3MzE4Y2YyZWQyMmU3ZTkwNjJlNzY5Y2IzZDI0ZmU4NjlhOTdjYjdmOTY5YzM4NzE0NzFiMWJhNjBlZWNhYWQ2ODNkMjBjNWUxNDIyZTM4&amp%3Bb=1)

--  
Detlev Offenbach  
det...@die-offenbachs.de