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:
};