<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hello All,<BR>
&nbsp;<BR>
Our project made some of the functions with Qt and also encapsulate them with dll library, <BR>
the imported module, we made it following the boost.python syntax, was built successfully, <BR>
and imported into python 2.6.2&nbsp;with no errors, but our issues are, the functions donot work, no response<BR>
&nbsp;<BR>
as our investigation, it supposes to be&nbsp;Qt signal/slot donot work in the python module<BR>
&nbsp;<BR>
I made a&nbsp;simple example&nbsp;below:<BR>
Would someone help me check what codes i need add to make the signal/slot work in the python, Thanks a lot<BR>
&nbsp;<BR>
Boost 1.40<BR>
Python 2.6.2<BR>
++++++++++++++++++++++++++++++++++++++++++++++++++.h<BR>
#ifndef SIGALE_H<BR>#define SIGALE_H<BR>#include&lt;QObject&gt;<BR>
&nbsp;<BR>
class SignalMine : public QObject<BR>{<BR>&nbsp;&nbsp;&nbsp; Q_OBJECT<BR>public:<BR>&nbsp;&nbsp;&nbsp; SignalMine(QObject* parent = 0);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; void submit(void){emit trigger();}<BR>signals:<BR>&nbsp;&nbsp;&nbsp; void trigger(void);<BR>&nbsp;&nbsp;&nbsp; <BR>protected slots:<BR>&nbsp;&nbsp;&nbsp; void printOut(void);<BR>&nbsp;&nbsp;&nbsp; <BR>};<BR>
#endif<BR>
++++++++++++++++++++++++++++++++++++++++++++++++++.cpp<BR>
#include&lt;iostream.h&gt;<BR>#include"example.h"<BR>
&nbsp;<BR>
SignalMine::SignalMine(QObject* parent):QObject(parent)<BR>{<BR>&nbsp;&nbsp;&nbsp; connect(this, SIGNAL(trigger()), this, SLOT(printOut()));&nbsp;&nbsp;&nbsp; <BR>}<BR>
void SignalMine::printOut()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; "Get signal!" &lt;&lt; endl;&nbsp; <BR>}<BR>
&nbsp;<BR>
//! for boost.python<BR>
#include &lt;boost/python.hpp&gt;<BR>using namespace boost::python;<BR>
BOOST_PYTHON_MODULE(SIGN)<BR>{<BR>&nbsp;&nbsp;&nbsp; class_&lt;QObject, boost::noncopyable&gt;("QObject");<BR>&nbsp;&nbsp;&nbsp; class_&lt;SignalMine, boost::noncopyable, bases&lt;QObject&gt;&gt;("SignalMineller")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .def("submit", &amp;SignalMine::submit);<BR>}<BR>
&nbsp;<BR>
&nbsp;<BR>                                               <br /><hr />Keep your friends updated¡ª <a href='http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010' target='_new'>even when you¡¯re not signed in.</a></body>
</html>