<DIV><BR>I'm on Windows using Microsoft Visual Stdio2008, Python 3.1, PyQt-win-gpl-4.6.2, sip-4.9.2 and Qt 4.5.3.<BR>First,I have <FONT face=Calibri>myqtlibtest</FONT>.h; <FONT face=Calibri>myqtlibtest</FONT>.lib;<FONT face=Calibri>myqtlibtest</FONT>.dll from the <FONT face=Calibri>myqtlibtest project.It's simple.Just like this:</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>myqtlibtest</FONT><FONT face=Verdana>.h:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#008000>#ifndef MYQTLIBTEST_H<BR>#define MYQTLIBTEST_H</FONT></DIV>
<DIV><FONT color=#008000>#include "myqtlibtest_global.h"</FONT></DIV>
<DIV><FONT color=#008000>#include <qstring.h><BR>#include <qdebug.h></FONT></DIV>
<DIV><FONT color=#008000>class MYQTLIBTEST_EXPORT myqtlibtest<BR>{<BR>public:<BR> myqtlibtest();<BR> ~myqtlibtest();<BR> void show(){<BR> qDebug()<<QString("hello");<BR> }</FONT></DIV>
<DIV><FONT color=#008000>private:</FONT></DIV>
<DIV><FONT color=#008000>};</FONT></DIV>
<DIV><FONT color=#008000>#endif // MYQTLIBTEST_H</FONT><BR> </DIV>
<DIV><BR>when I wrap with SIP. Then my sip file is like this:</DIV>
<DIV> </DIV>
<DIV><FONT face=Calibri>myqtlibtest</FONT><FONT face=Verdana>.sip:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#008000>%</FONT><FONT color=#008080>Module myqtlibtest 0</FONT></DIV>
<DIV><FONT color=#008080>%Import C:/Python31/Lib/site-packages/PyQt4/sip/PyQt4/QtCore/QtCoremod.sip</FONT></DIV>
<DIV><FONT color=#008080></FONT> </DIV>
<DIV><FONT color=#008080>%If (Qt_4_5_3 -)</FONT></DIV>
<DIV><BR><FONT color=#008080>class myqtlibtest<BR>{</FONT></DIV>
<DIV><FONT color=#008080>%TypeHeaderCode</FONT></DIV>
<DIV><FONT color=#008080>#include "myqtlibtest.h"</FONT></DIV>
<DIV><FONT color=#008080>%End</FONT></DIV>
<DIV><FONT color=#008080>public:<BR> myqtlibtest();<BR> ~myqtlibtest();<BR> void show();<BR>private:</FONT></DIV>
<DIV><FONT color=#008080>};<BR>%End</FONT></DIV>
<DIV> </DIV>
<DIV>I'd like to add Qt classes to my python program.<BR><BR>I've gotten the file of myqtlibtest.pyd by my sip file, but when I run my myqtlibtest.pyd ,I got nothing just like this:</DIV>
<DIV>when I run it on python idle.(<FONT face=Calibri>myqtlibtest is my module</FONT>)</DIV>
<DIV> </DIV>
<DIV>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT face=Calibri>>>> import myqtlibtest</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT face=Calibri>>>> help(myqtlibtest)</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT face=Calibri>Help on module myqtlibtest:</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><?XML:NAMESPACE PREFIX = O /><O:P></O:P><FONT face=Calibri> </FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT face=Calibri>NAME</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT face=Calibri><SPAN style="mso-spacerun: yes"> </SPAN>myqtlibtest</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><O:P></O:P><FONT face=Calibri> </FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT face=Calibri>FILE</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT face=Calibri><SPAN style="mso-spacerun: yes"> </SPAN>c:\python31\dlls\myqtlibtest.pyd</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><O:P></O:P><FONT face=Calibri> </FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><O:P></O:P><FONT face=Calibri> >>> myqtlibtest.myqtlibtest()<BR><FONT color=#ff6600>Traceback (most recent call last):<BR> File "<pyshell#11>", line 1, in <module><BR> myqtlibtest.myqtlibtest()<BR>AttributeError: 'module' object has no attribute 'myqtlibtest'<BR></FONT>>>> a=myqtlibtest.myqtlibtest()<BR><FONT color=#ff6600>Traceback (most recent call last):<BR> File "<pyshell#12>", line 1, in <module><BR> a=myqtlibtest.myqtlibtest()<BR>AttributeError: 'module' object has no attribute 'myqtlibtest'<BR></FONT>>>> </FONT></SPAN><BR><BR>Where is the wrapping class?<BR>Any help? Thanks - susan</P></DIV>