discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] SWIG and QT (QT4_WRAP_CPP issues)


From: Stefan Wunsch
Subject: Re: [Discuss-gnuradio] SWIG and QT (QT4_WRAP_CPP issues)
Date: Fri, 20 Jun 2014 00:23:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Sylvain solved it in a sec ;) There is no need to get the classes with
the qt stuff through swig. Solution is including the additional qt
classes only in cmake and wrap them with QT4_WRAP_CPP cause of the
Q_OBJECT macro but dont care about them in the *_swig.i file.

Am 19.06.2014 23:31, schrieb Stefan Wunsch:
> Hi!
> 
> I try to add a QT GUI to my OOT module (gr-radar). I have some issues
> with including the QT stuff in cmake and swig.
> 
> The problem is this error:
> 
> ## /gr-radar/swig/../lib/range_velocity_diagram.h:45: Error: Syntax
> error in input(3).
> ## make[2]: *** [swig/radar_swigPYTHON_wrap.cxx] Error 1
> ## make[1]: *** [swig/CMakeFiles/pygen_swig_9a820.dir/all] Error 2
> 
> The line 45 refers to
> ## public slots:
> Whole class definition is appended.[0]
> 
> If I build my module without 'public slots:' line but WITH the Q_OBJECT
> line everything runs fine and I get a new QT window. So I suppose that
> the additional class range_velocity_diagram is included correctly in
> cmake and swig. Also I think the Q_OBJECT macro is accepted by cmake and
> swig.
> 
> I have looked at gr-qtgui and added QT4_WRAP_CPP to get the Q_OBJECT
> macro running. My changes in CMakeLists.txt (lib directory):
> 
> set(QTGUI_MOC_HEADERS range_velocity_diagram.h)
> QT4_WRAP_CPP(QTGUI_MOC_OUTFILES ${QTGUI_MOC_HEADERS})
> add_library(gnuradio-radar SHARED ${radar_sources} ${QTGUI_MOC_OUTFILES})
> 
> Do I need to add more to get swig running with the QT slots and signals?
> I am correct with the assumption that cmake and swig accepts the
> Q_OBJECT macro?
> 
> Best regards
> Stefan
> 
> [0] Class definition range_velocity_diagram
> class range_velocity_diagram : public QWidget
> {
> Q_OBJECT;
> 
> public:
>       range_velocity_diagram();
>       ~range_velocity_diagram();
>       
> private:
>       QwtPlot* d_plot;
>       QwtPlotCurve* d_curve;
>       
> public slots:
> 
> };
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]