diff options
-rw-r--r-- | docs/doxygen/other/group_defs.dox | 1 | ||||
-rw-r--r-- | docs/doxygen/other/main_page.dox | 1 | ||||
-rw-r--r-- | gr-qtgui/doc/Makefile.am | 27 | ||||
-rw-r--r-- | gr-qtgui/doc/README.qtgui | 12 | ||||
-rw-r--r-- | gr-qtgui/doc/qtgui.dox | 77 |
5 files changed, 118 insertions, 0 deletions
diff --git a/docs/doxygen/other/group_defs.dox b/docs/doxygen/other/group_defs.dox index e063957ba..27b2109dc 100644 --- a/docs/doxygen/other/group_defs.dox +++ b/docs/doxygen/other/group_defs.dox @@ -28,6 +28,7 @@ /*! \defgroup slicedice_blk Slicing and Dicing Streams */ /*! \defgroup vocoder_blk Voice Encoders and Decoders */ /*! \defgroup digital Digital Modulation Blocks */ +/*! \defgroup qtgui_blk QT Graphical Interfaces */ /*! * \defgroup base_blk Base classes for GR Blocks diff --git a/docs/doxygen/other/main_page.dox b/docs/doxygen/other/main_page.dox index 0d2ce5d64..0abf934d5 100644 --- a/docs/doxygen/other/main_page.dox +++ b/docs/doxygen/other/main_page.dox @@ -12,5 +12,6 @@ worked out, please bear with us, or better yet, solve it for us! More details on packages in GNU Radio: \li \ref page_digital \li \ref page_vocoder +\li \ref page_qtgui */ diff --git a/gr-qtgui/doc/Makefile.am b/gr-qtgui/doc/Makefile.am new file mode 100644 index 000000000..b65eb062f --- /dev/null +++ b/gr-qtgui/doc/Makefile.am @@ -0,0 +1,27 @@ +# +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/Makefile.common + +SUBDIRS = + +dist_gr_doc_DATA = \ + README.qtgui diff --git a/gr-qtgui/doc/README.qtgui b/gr-qtgui/doc/README.qtgui new file mode 100644 index 000000000..e54c3d907 --- /dev/null +++ b/gr-qtgui/doc/README.qtgui @@ -0,0 +1,12 @@ +This is the gr-qtgui package. It contains various QT-based graphical +user interface blocks that add graphical sinks to a GNU Radio +flowgraph. The Python namespaces is in gnuradio.qtgui, which would be normally +imported as: + + from gnuradio import qtgui + +See the Doxygen documentation for details about the blocks available +in this package. A quick listing of the details can be found in Python +after importing by using: + + help(qtgui) diff --git a/gr-qtgui/doc/qtgui.dox b/gr-qtgui/doc/qtgui.dox new file mode 100644 index 000000000..c7f4b7146 --- /dev/null +++ b/gr-qtgui/doc/qtgui.dox @@ -0,0 +1,77 @@ +/*! \page page_qtgui QT Graphical User Interface + +\section Introduction + +This is the gr-qtgui package. It contains various QT-based graphical +user interface blocks that add graphical sinks to a GNU Radio +flowgraph. The Python namespaces is in gnuradio.qtgui, which would be normally +imported as: + +\code + from gnuradio import qtgui +\endcode + +See the Doxygen documentation for details about the blocks available +in this package. The relevant blocks are listed in the \ref +qtgui_blk group. + +A quick listing of the details can be found in Python after importing +by using: + +\code + help(qtgui) +\endcode + + +\section Dependencies + +The QT GUI blocks require the following dependencies. + +\li QtCore (version >= 4.4) +\li QtGui (version >= 4.4) +\li QtOpenGL (version >= 4.4) +\li PyQt4 for Qt4 (version >= 4.4) +\li Qwt (version >= 5.2) +\li PyQwt5 for Qt4 (version >= 5.2) + +\section Usage + +To use the qtgui interface, a bit of boiler-plate lines must be +included. First, the sink is defined, then it must be exposed from C++ +into Python using the "sip.wrapinstance" command, and finally, the +"show" method is run on the new Python object. This sets up the QT +environment to show the widget, but the qApplication must also be +launched. + +In the "main" function of the code, the qApp is retrieved. Then, after +the GNU Radio top block is started (remember that start() is a +non-blocking call to launch the main thread of the flowgraph), the +qapp's "exec_()" function is called. This function is a blocking call +while the GUI is alive. + +\code +from PyQt4 import Qt +from gnuradio.qtgui import qtgui +import sys, sip + +class grclass(gr.top_block): + .... + + self.snk = qtgui.sink_c(1024, #fftsize + samp_rate, #bw + "QT GUI Plot") #name + + self.snk_win = sip.wrapinstance(self.snk.pyqwidget(), Qt.QWidget) + self.snk_win.show() + +def main(): + qapp = Qt.QApplication(sys.argv) + tb = grclass() + tb.start() + qapp.exec_() + tb.stop() + + +\endcode + +*/ |