discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Include own GUI in existing QT windows


From: Sebastian Müller
Subject: Re: [Discuss-gnuradio] Include own GUI in existing QT windows
Date: Fri, 10 Jun 2016 14:04:09 +0200

Hi,

update on this topic: I figured out that passing the parent does not seem to be the problem. The important lines are in the <make> tag of the XML file, which result in the python flowgraph to:

> self.inspector_qtgui_sink_vf_0 = inspector.qtgui_inspector_sink_vf(4096)
> self._inspector_qtgui_sink_vf_0_win = sip.wrapinstance(self.inspector_qtgui_sink_vf_0.pyqwidget(), Qt.QWidget)
> self.top_layout.addWidget(self._inspector_qtgui_sink_vf_0_win)

I have copied all of the code concerning pyqwidget() from gr-qtwidget (at least I think so), but the flowgraph still fails with the error:

> self._inspector_qtgui_sink_vf_0_win = sip.wrapinstance(self.inspector_qtgui_sink_vf_0.pyqwidget(), Qt.QWidget)
> TypeError: must be integer<K>, not SwigPyObject

So it seems as if the PyObject* pyqwidget() is SWIGged, which is not necessary here. Can anyone tell me how to fix this error?

Cheers,
Sebastian

2016-06-09 14:18 GMT+02:00 Sebastian Müller <address@hidden>:
Hi list,

can anyone help me with this? I'm trying to build an own QT GUI, which opens in an own window so far. I want to include my GUI in existing QT windows (like all the gr-qtgui blocks do) so that there is only one window with all the QT content in it.

So far I have configured the <make> call in the GRC XML like this:

<make>#set $win = 'self._%s_win'%$id
inspector.qtgui_inspector_sink_vf($fft_len)
self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget)
$(gui_hint()($win))</make>

qtgui_inspector_sink_vf_impl constructor looks like this:

qtgui_inspector_sink_vf_impl(int fft_len, QWidget *parent);

This block creates an instance of "inspector_plot" which inherits QWidget class:

inspector_plot(int fft_len, std::vector<float> *buffer, QWidget* parent) : QWidget(parent).

I also created a PyObject* pyqwidget() in the public header and the impl header and source files (copied from gr-qtgui). When trying to start, the python flowgraph fails because it does not seem to find pyqwidget(): AttributeError: 'qtgui_inspector_sink_vf_sptr' object has no attribute 'pyqwidget'.

Would be great if someone could help with what I'm missing.

Cheers,
Sebastian



reply via email to

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