<div style="font-family:Verdana;font-size:14px;color:#000;"><DIV>Thank you .I got it.</DIV><div style="font:Verdana normal 14px;color:#000;padding:8px;background:#efefef;"><div> </div><div> </div><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="FONT-SIZE: 12px;"><div><b>发件人:</b> "Phil Thompson"<phil@riverbankcomputing.com>;</div><div><b>发送时间:</b> 2010年8月23日(星期一) 下午5:06</div><div><b>收件人:</b> "燕子"<xiaoyan0325@tom.com>;</div><div><b>主题:</b> Re: [PyQt] about the sip wrappers</div></div><div> </div>On Mon, 23 Aug 2010 11:30:55 +0800, "燕子" <xiaoyan0325@tom.com> wrote:<BR>> Dear sir.<BR>>  my head file is </:includetail><BR>>  myqtlibtest.h:</:includetail><BR>>  #ifndef MYQTLIBTEST_H<BR>> #define MYQTLIBTEST_H</:includetail><BR>>  #include "myqtlibtest_global.h"<BR>> //#include <windows.h><BR>> #include <qstring.h><BR>> #include <qdebug.h><BR>> #include "test.h"</:includetail><BR>>  class MYQTLIBTEST_EXPORT myqtlibtest<BR>> {<BR>> public:<BR>>  myqtlibtest();<BR>>  ~myqtlibtest(); </:includetail><BR>>   void show();<BR>>  int testshow();</:includetail><BR>>  private:<BR>>  Test *testpointer;</:includetail><BR>>  };<BR>> MYQTLIBTEST_EXPORT int myshow(int aa);</:includetail><BR>>  #endif // MYQTLIBTEST_H</:includetail><BR>>  my sip wrappers is</:includetail><BR>>  myqtlibtest.sip:</:includetail><BR>>  %Module myqtlibtest 0</:includetail><BR>>  <BR>> %Import QtCore/QtCoremod.sip<BR>> %Import QtGui/QtGuimod.sip<BR>>  class  myqtlibtest<BR>> {<BR>>  %TypeHeaderCode<BR>>  #include "myqtlibtest.h"<BR>>  %End<BR>>  public:<BR>>  myqtlibtest();<BR>>  ~myqtlibtest();<BR>>        void show();<BR>>        int testshow();<BR>>   private:<BR>>  Test *testpointer;<BR>> };<BR>> int myshow(int aa);<BR>>   <BR>>  when I run the command of "sip -I ..\sip\PyQt4\ -t Qt_4_5_3  -t WS_WIN<BR>>  myqtlibtest.sip<BR>> "<BR>>   <BR>>   the error is "sip:myqtlibtest.sip :23:Class variables must be in the<BR>>   public section." but I still need the private variable "Test<BR>>   *testpointer"<BR>>   <BR>>  what can I do?<BR><BR>If you need the variable in your C++ code then just omit it from the .sip<BR>file. If you need it from you Python code then you can't and need to change<BR>the C++ to make it public.<BR><BR>Phil<BR><BR></div></div>