Re: [PyKDE] QMemArray problem
Le Mercredi 18 Février 2004 20:28, Phil Thompson a écrit : That's a SIP 3 bug (SIP 4 is Ok I think). It should be fixed in tonight's snapshot. It works, thanks a lot. -- Aurélien Gâteau - Dental On Line ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] QMemArray problem
Le Mardi 17 Février 2004 19:16, Phil Thompson a écrit : Yesterday I upgraded to Sip 3.10 and this does not work anymore. I get this error message: g++ -f -c -pipe -w -O2 -o dolimagefilterscmodule.o dolimagefilterscmodule.cpp -I/usr/share/qt3/mkspecs/default -I. -I/usr/include/python2.2 -I/usr/include -I/usr/share/qt3/include -D_REENTRANT -DSIP_MAKE_MODULE_DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT In file included from dolimagefilterscmodule.cpp:5: dolimageutils.sip:5: sipqtQMemArray.h: No such file or directory Any idea? Try just removing the line. If I do so, I get this message: g++ -f -c -pipe -w -O2 -o dolimagefilterscmodule.o dolimagefilterscmodule.cpp -I/usr/share/qt3/mkspecs/default -I. -I/usr/include/python2.2 -I../../../../build/include -I/usr/share/qt3/include -D_REENTRANT -DSIP_MAKE_MODULE_DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT dolimagefilterscmodule.cpp: In function `struct PyObject * sipDo_DolImageUtils_compute8BitImageHistogram(PyObject *, PyObject *)': dolimagefilterscmodule.cpp:65: implicit declaration of function `int sipConvertFrom_QMemArray_1800(...)' dolimagefilterscmodule.cpp:65: initialization to `PyObject *' from `int' lacks a cast -- Aurélien Gâteau - Dental On Line ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] QMemArray problem
Hi, I wrote a function which returns a QMemArrayint. Using Sip 3.7, I used to bind it like this: %Import qtmod.sip %HeaderCode #include dolimageutils.h #include sipqtQMemArray.h %End namespace DolImageUtils { QMemArrayint compute8BitImageHistogram(const QImage); }; Yesterday I upgraded to Sip 3.10 and this does not work anymore. I get this error message: g++ -f -c -pipe -w -O2 -o dolimagefilterscmodule.o dolimagefilterscmodule.cpp -I/usr/share/qt3/mkspecs/default -I. -I/usr/include/python2.2 -I/usr/include -I/usr/share/qt3/include -D_REENTRANT -DSIP_MAKE_MODULE_DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT In file included from dolimagefilterscmodule.cpp:5: dolimageutils.sip:5: sipqtQMemArray.h: No such file or directory Any idea? -- Aurélien Gâteau - Dental On Line ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Binding special connect functions
Le Lundi 27 Octobre 2003 11:50, Aurélien Gâteau a écrit : I just tried it. The SIP file compiles correctly, but whenever I call the connect method, I get this new error: /-- RuntimeError: Signal has wrong argument types for slot --/ How do I convince Python that my slot is using the correct argument types? Nevermind, I finally decide to move everything to QObjects, this way I can use standard connect methods. Thanks anyway Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Trouble binding code with SIP
Le Lundi 13 Octobre 2003 19:06, Phil Thompson a écrit : After the class Listener : QObject { line. Sip parses it correctly, but compilation fails in the same place. That's expected. But if you put it in the DolSphinx namespace it probably wouldn't parse. Yes, I saw that too. Anyway, that's not my biggest problem right now, I can easily cope with the workaround I found. On the other hand, do you have any idea about my post event problem (see my next question on the list)? Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] postEvent problem
Le Lundi 13 Octobre 2003 17:57, Aurélien Gâteau a écrit : Hello again, list I have another problem: the code I want to bind with work like this: In my C++ code, I run a thread which is monitoring various things. When interesting stuff happens, the thread notify a listener about it using QApplication::postEvent(myListener, myEvent). In my C++ test program, all works well, but in py Python test program, the posted event never reaches the listener. As anyone encountered the same problem? Some more informations: the C++ code (libdolsphinx) I wrote is a library listening words from a voice recognition tool. Inside libdolsphinx, there is a Qt thread which is waiting for words and post Qt events for them. The (simplified) code looks like this: --- namespace DolSphinx { static Listener* sListener; void setListener(Listener* listener) { sListener=listener; } class ListenThread : public QThread { void run() { while(true) { if (wordHeard) { if (sListener) { QApplication::postEvent(sListener, new DolSphinxWordHeard(word)); } } } } }; } --- sListener is my DolSphinx::Listener object. The test code starts the thread loop, then calls DolSphinx::setListener with a DolSphinx::Listener object. The Listener object receives the posted event in its eventFilter() method, and emit Qt signals. In my C++ test code, the Listener object receives correctly the posted event. In the Python one, it doesn't. Tell me if you need more information. Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] postEvent problem
Le Mardi 14 Octobre 2003 10:58, Aurélien Gâteau a écrit : Le Lundi 13 Octobre 2003 17:57, Aurélien Gâteau a écrit : Hello again, list Replying to myself again :-) My error was that I forgot to declare the customEvent(QCustomEvent*) method of my listener in the sip file. Adding it fixed my problem. Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Trouble binding code with SIP
Replying to myself: I found some kind of workaround: I created a parameter-less version of my stateChanged signal. This way the generated code builds correctly. Thanks for your help, Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] postEvent problem
Hello again, list I have another problem: the code I want to bind with work like this: In my C++ code, I run a thread which is monitoring various things. When interesting stuff happens, the thread notify a listener about it using QApplication::postEvent(myListener, myEvent). In my C++ test program, all works well, but in py Python test program, the posted event never reaches the listener. As anyone encountered the same problem? Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Trouble binding code with SIP
Le Lundi 13 Octobre 2003 18:23, Phil Thompson a écrit : That wouldn't make any difference. The %HeaderCode section in a class definition is used to #include all header files needed by that class - normally just the one. I just tried it again. I made some simplifications, like putting my Listener into DolSphinx namespace, so here is the new sip file (only one now). --- dolsphinx.sip --- %Module dolsphinx %Import qtmod.sip %HeaderCode #include dolsphinx.h #include dolsphinxlistener.h %End namespace DolSphinx { enum State { Uninitialized, Initializing, Listening, Calibrating, Paused }; class Listener : QObject { public: Listener(QObject* /TransferThis/ = 0); ~Listener(); void wordConnect(const QString, SIP_RXOBJ_CON,SIP_SLOT_CON()); void wordDisconnect(const QString, SIP_RXOBJ_CON,SIP_SLOT_CON()); signals: void wordHeard(const QString); void stateChanged(DolSphinx::State); }; /* function snip */ DolSphinx::Listener* listener(); void setListener(DolSphinx::Listener*); DolSphinx::State state(); DolSphinx::State stringToState(const QString); QString stateToString(DolSphinx::State); }; --- What is interesting is that it does not fail on stateToString(DolSphinx::State). Maybe it has something to do with the fact that stateChanged is a signal. The broken file is sipdolsphinxProxydolsphinx.h. It's content is: --- sipdolsphinxProxydolsphinx.h --- // Module proxy signal/slot handler class. // // Generated by SIP 3.7 (build 102) on Mon Oct 13 18:25:41 2003 #ifndef _dolsphinxPROXY_H #define _dolsphinxPROXY_H #include sipQt.h #include qobject.h #include qapplication.h #include qstring.h class sipProxydolsphinx: public sipProxy { Q_OBJECT public: char *getProxySlot(char *); public slots: void proxySlot(DolSphinx::State); // - compilation fails here void proxySlot(const QString); void proxySlot(QObject *); void proxySlot(); }; #endif --- Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Translation trouble
Le Vendredi 25 Juillet 2003 18:50, vous avez écrit : Can you send me the .ui file? Thanks, Phil Hum... I'm feeling stupid. The file I was looking at was generated by an older version of pyuic, I forgot to remove all pyuic generated files. Sorry for the trouble. Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] Translation trouble
Hi, Sometimes, the translation of strings in our .ui files are not displayed, the original string is used instead. It seems there's a context problem. According to: http://www.riverbankcomputing.co.uk/pyqt/docs/x163.html (Things to be Aware of), pyuic uses QApplication.translate() but after looking at the code it's not the case, I discovered it uses self.tr() instead. Replacing self.tr() with qApp.translate() fixed the bug. Any idea why pyuic does not do what it is supposed to? Regards, Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Translation trouble
Le Vendredi 25 Juillet 2003 18:41, vous avez écrit : On Friday 25 July 2003 5:16 pm, Aurélien Gâteau wrote: Hi, Sometimes, the translation of strings in our .ui files are not displayed, the original string is used instead. It seems there's a context problem. According to: http://www.riverbankcomputing.co.uk/pyqt/docs/x163.html (Things to be Aware of), pyuic uses QApplication.translate() but after looking at the code it's not the case, I discovered it uses self.tr() instead. Replacing self.tr() with qApp.translate() fixed the bug. Any idea why pyuic does not do what it is supposed to? Which version of PyQt? The documentation describes v3.7. This is PyQt 3.7. Aurélien ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde