<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>
<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 with no errors, but our issues are, the functions donot work, no response<BR>
<BR>
as our investigation, it supposes to be Qt signal/slot donot work in the python module<BR>
<BR>
I made a simple example 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>
<BR>
Boost 1.40<BR>
Python 2.6.2<BR>
++++++++++++++++++++++++++++++++++++++++++++++++++.h<BR>
#ifndef SIGALE_H<BR>#define SIGALE_H<BR>#include<QObject><BR>
<BR>
class SignalMine : public QObject<BR>{<BR> Q_OBJECT<BR>public:<BR> SignalMine(QObject* parent = 0);<BR> <BR> void submit(void){emit trigger();}<BR>signals:<BR> void trigger(void);<BR> <BR>protected slots:<BR> void printOut(void);<BR> <BR>};<BR>
#endif<BR>
++++++++++++++++++++++++++++++++++++++++++++++++++.cpp<BR>
#include<iostream.h><BR>#include"example.h"<BR>
<BR>
SignalMine::SignalMine(QObject* parent):QObject(parent)<BR>{<BR> connect(this, SIGNAL(trigger()), this, SLOT(printOut())); <BR>}<BR>
void SignalMine::printOut()<BR>{<BR> cout << "Get signal!" << endl; <BR>}<BR>
<BR>
//! for boost.python<BR>
#include <boost/python.hpp><BR>using namespace boost::python;<BR>
BOOST_PYTHON_MODULE(SIGN)<BR>{<BR> class_<QObject, boost::noncopyable>("QObject");<BR> class_<SignalMine, boost::noncopyable, bases<QObject>>("SignalMineller")<BR> .def("submit", &SignalMine::submit);<BR>}<BR>
<BR>
<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>