diff options
Diffstat (limited to 'gr-qtgui')
82 files changed, 2443 insertions, 1192 deletions
diff --git a/gr-qtgui/CMakeLists.txt b/gr-qtgui/CMakeLists.txt index ad10363c1e..e467567b1c 100644 --- a/gr-qtgui/CMakeLists.txt +++ b/gr-qtgui/CMakeLists.txt @@ -22,14 +22,27 @@ ######################################################################## include(GrBoost) -find_package(Qt4 4.2.0 COMPONENTS QtCore QtGui) - -find_package(Qwt) - find_package(PythonLibs 2) include(GrPython) -GR_PYTHON_CHECK_MODULE("PyQt4" PyQt4 True PYQT4_FOUND) + +set(DESIRED_QT_VERSION 5 CACHE STRING "The Qt version to use (4 or 5)") +set_property(CACHE DESIRED_QT_VERSION PROPERTY STRINGS 4 5) + +if (DESIRED_QT_VERSION MATCHES 4) + find_package(Qt4 COMPONENTS QtCore QtGui) + set(QT_FOUND ${Qt4_FOUND}) + include(GrSetupQt4) +else() + find_package(Qt5Widgets) + set(QT_FOUND ${Qt5Widgets_FOUND}) + set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) + set(QT_INCLUDE_DIRS ${Qt5Widgets_INCLUDE_DIRS}) +endif() + +GR_PYTHON_CHECK_MODULE("PyQt${DESIRED_QT_VERSION}" PyQt${DESIRED_QT_VERSION} True PYQT${DESIRED_QT_VERSION}_FOUND) + +find_package(Qwt) ######################################################################## # Register component @@ -37,13 +50,13 @@ GR_PYTHON_CHECK_MODULE("PyQt4" PyQt4 True PYQT4_FOUND) include(GrComponent) if(NOT CMAKE_CROSSCOMPILING) set(qt_gui_python_deps - PYQT4_FOUND + PYQT${DESIRED_QT_VERSION}_FOUND ) endif(NOT CMAKE_CROSSCOMPILING) GR_REGISTER_COMPONENT("gr-qtgui" ENABLE_GR_QTGUI Boost_FOUND - QT4_FOUND + QT_FOUND QWT_FOUND ENABLE_VOLK ENABLE_GNURADIO_RUNTIME @@ -66,43 +79,6 @@ SET(GR_PKG_QTGUI_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/qt-gui) ######################################################################## if(ENABLE_GR_QTGUI) -# populate the environment with QT variables -include(GrSetupQt4) - -######################################################################## -# Setup CPack components -######################################################################## -include(GrPackage) -CPACK_SET(CPACK_COMPONENT_GROUP_QTGUI_DESCRIPTION "GNU Radio QtGUI Blocks") - -CPACK_COMPONENT("qtgui_runtime" - GROUP "QtGUI" - DISPLAY_NAME "Runtime" - DESCRIPTION "Runtime" - DEPENDS "runtime_runtime" -) - -CPACK_COMPONENT("qtgui_devel" - GROUP "QtGUI" - DISPLAY_NAME "Development" - DESCRIPTION "C++ headers, package config, import libraries" - DEPENDS "runtime_devel" -) - -CPACK_COMPONENT("qtgui_python" - GROUP "QtGUI" - DISPLAY_NAME "Python" - DESCRIPTION "Python modules for runtime; GRC xml files" - DEPENDS "runtime_python;qtgui_runtime" -) - -CPACK_COMPONENT("qtgui_swig" - GROUP "QtGUI" - DISPLAY_NAME "SWIG" - DESCRIPTION "SWIG development .i files" - DEPENDS "runtime_swig;qtgui_python;qtgui_devel" -) - ######################################################################## # Add subdirectories ######################################################################## @@ -129,7 +105,6 @@ configure_file( install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-qtgui.pc DESTINATION ${GR_LIBRARY_DIR}/pkgconfig - COMPONENT "qtgui_devel" ) ######################################################################## @@ -138,7 +113,6 @@ install( install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr-qtgui.conf DESTINATION ${GR_PREFSDIR} - COMPONENT "qtgui" ) @@ -152,7 +126,6 @@ install( themes/alt.qss themes/projector.qss DESTINATION ${GR_THEMES_DIR} - COMPONENT "qtgui" ) endif(ENABLE_GR_QTGUI) diff --git a/gr-qtgui/apps/CMakeLists.txt b/gr-qtgui/apps/CMakeLists.txt index 3c64cb6e0a..6a8e6c51aa 100644 --- a/gr-qtgui/apps/CMakeLists.txt +++ b/gr-qtgui/apps/CMakeLists.txt @@ -33,7 +33,6 @@ GR_PYTHON_INSTALL( plot_time_form.py plot_time_raster_form.py DESTINATION ${GR_PYTHON_DIR}/gnuradio/qtgui - COMPONENT "qtgui_python" ) GR_PYTHON_INSTALL( @@ -58,5 +57,4 @@ GR_PYTHON_INSTALL( gr_spectrogram_plot gr_constellation_plot DESTINATION ${GR_RUNTIME_DIR} - COMPONENT "qtgui_python" ) diff --git a/gr-qtgui/apps/gr_constellation_plot b/gr-qtgui/apps/gr_constellation_plot index 528bb97e5a..ff5db1a9a6 100755 --- a/gr-qtgui/apps/gr_constellation_plot +++ b/gr-qtgui/apps/gr_constellation_plot @@ -22,8 +22,8 @@ from gnuradio import gr from gnuradio import blocks -from gnuradio.eng_option import eng_option -from optparse import OptionParser +from gnuradio.eng_arg import eng_float, intx +from argparse import ArgumentParser import os, sys try: @@ -143,32 +143,27 @@ class my_top_block(gr.top_block): def main(): description = "Plots the constellations of a list of files." - parser = OptionParser(option_class=eng_option, description=description, + parser = ArgumentParser(description=description, conflict_handler="resolve") - parser.add_option("-N", "--nsamples", type="int", default=1000000, - help="Set the number of samples to display [default=%default]") - parser.add_option("-S", "--start", type="int", default=0, - help="Starting sample number [default=%default]") - (options, args) = parser.parse_args() + parser.add_argument("-N", "--nsamples", type=int, default=1000000, + help="Set the number of samples to display [default=%(default)r]") + parser.add_argument("-S", "--start", type=int, default=0, + help="Starting sample number [default=%(default)r]") + parser.add_argument("files", nargs="+", metavar='FILE') + args = parser.parse_args() - if(len(args) < 1): - parser.print_help() - sys.exit(0) - - filelist = list(args) - - nsamples = options.nsamples + filelist = args.files + nsamples = args.nsamples # Find the smallest number of samples in all files and use that as # a maximum value possible. filesizes = [] for f in filelist: if(os.path.exists(f)): - filesizes.append(os.path.getsize(f) / gr.sizeof_gr_complex) + filesizes.append(os.path.getsize(f) // gr.sizeof_gr_complex) max_nsamples = min(filesizes) - tb = my_top_block(filelist, - options.start, nsamples, max_nsamples); + tb = my_top_block(filelist, args.start, nsamples, max_nsamples); main_box = plot_constellation_form(tb, 'GNU Radio Constellation Plot', 10000.0) for n in xrange(tb._nsigs): diff --git a/gr-qtgui/apps/gr_psd_plot_b b/gr-qtgui/apps/gr_psd_plot_b index 606311af48..26263112ca 100755 --- a/gr-qtgui/apps/gr_psd_plot_b +++ b/gr-qtgui/apps/gr_psd_plot_b @@ -54,16 +54,15 @@ class psd_plot_b(plot_base.plot_base): def main(): description = "Plots the PSDs of a list of files. Files are a binary list of bytes." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = psd_plot_b(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average) + tb = psd_plot_b(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average) main_box = plot_base.plot_psd_form(tb, 'GNU Radio PSD Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_psd_plot_c b/gr-qtgui/apps/gr_psd_plot_c index 6df9fae190..1bd847b607 100755 --- a/gr-qtgui/apps/gr_psd_plot_c +++ b/gr-qtgui/apps/gr_psd_plot_c @@ -55,16 +55,15 @@ class psd_plot_c(plot_base.plot_base): def main(): description = "Plots the PSDs of a list of files. Files are a binary list of complex floats." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = psd_plot_c(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average) + tb = psd_plot_c(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average) main_box = plot_base.plot_psd_form(tb, 'GNU Radio PSD Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_psd_plot_f b/gr-qtgui/apps/gr_psd_plot_f index f07e3e8b50..04f1b03486 100755 --- a/gr-qtgui/apps/gr_psd_plot_f +++ b/gr-qtgui/apps/gr_psd_plot_f @@ -55,16 +55,15 @@ class psd_plot_f(plot_base.plot_base): def main(): description = "Plots the PSDs of a list of files. Files are a binary list of floats." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = psd_plot_f(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average) + tb = psd_plot_f(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average) main_box = plot_base.plot_psd_form(tb, 'GNU Radio PSD Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_psd_plot_i b/gr-qtgui/apps/gr_psd_plot_i index 1852345823..46bdd7bc84 100755 --- a/gr-qtgui/apps/gr_psd_plot_i +++ b/gr-qtgui/apps/gr_psd_plot_i @@ -54,16 +54,15 @@ class psd_plot_i(plot_base.plot_base): def main(): description = "Plots the PSDs of a list of files. Files are a binary list of integers." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = psd_plot_i(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average) + tb = psd_plot_i(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average) main_box = plot_base.plot_psd_form(tb, 'GNU Radio PSD Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_psd_plot_s b/gr-qtgui/apps/gr_psd_plot_s index c06076f1f9..8dc4a05d55 100755 --- a/gr-qtgui/apps/gr_psd_plot_s +++ b/gr-qtgui/apps/gr_psd_plot_s @@ -54,16 +54,15 @@ class psd_plot_s(plot_base.plot_base): def main(): description = "Plots the PSDs of a list of files. Files are a binary list of shorts." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = psd_plot_s(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average) + tb = psd_plot_s(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average) main_box = plot_base.plot_psd_form(tb, 'GNU Radio PSD Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_spectrogram_plot b/gr-qtgui/apps/gr_spectrogram_plot index db79f9dbad..8e8ba86757 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot +++ b/gr-qtgui/apps/gr_spectrogram_plot @@ -142,55 +142,54 @@ def read_header(filelist): def main(): description = 'Plots the spectrogram (waterfall) of a file with detached header.' description += ' Assumes header is <input_filename>.hdr' - (options, args) = plot_base.setup_options(description) - filelist = list(args) + args = plot_base.setup_options(description) # Attempt to read the header information - info = read_header(filelist) + info = read_header(args.files) # If no header, quit if not info: sys.stderr.write('Header not found\n') sys.exit(1) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) srate = info["rx_rate"] # Dispatch the proper function # Complex Types if(info["cplx"] == True): if( info["type"] == "float" ): - tb = spectrogram_plot_c(filelist, - options.center_frequency,srate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_c(args.files, + args.center_frequency,srate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); else: sys.stderr.write("Complex File Type " + info["type"]+ " not supported.\n") # Real Types else: if( info["type"] == "bytes" ): - tb = spectrogram_plot_b(filelist, - options.center_frequency,srate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_b(args.files, + args.center_frequency,srate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); elif( info["type"] == "int" ): - tb = spectrogram_plot_i(filelist, - options.center_frequency,srate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_i(args.files, + args.center_frequency,srate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); elif( info["type"] == "float" ): - tb = spectrogram_plot_f(filelist, - options.center_frequency,srate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_f(args.files, + args.center_frequency,srate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); elif( info["type"] == "short" ): - tb = spectrogram_plot_s(filelist, - options.center_frequency,srate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_s(args.files, + args.center_frequency,srate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); else: sys.stderr.write("Real File Type " + info["type"] + " not supported\n") main_box = plot_base.plot_spectrogram_form(tb, 'GNU Radio Spectrogram Plot') diff --git a/gr-qtgui/apps/gr_spectrogram_plot_b b/gr-qtgui/apps/gr_spectrogram_plot_b index 0d7a16ea6e..6045ebfadd 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_b +++ b/gr-qtgui/apps/gr_spectrogram_plot_b @@ -54,16 +54,15 @@ class spectrogram_plot_b(plot_base.plot_base): def main(): description = "Plots the spectrogram (waterfall) of a list of files. Files are a binary list of chars." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = spectrogram_plot_b(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_b(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); main_box = plot_base.plot_spectrogram_form(tb, 'GNU Radio Time Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_spectrogram_plot_c b/gr-qtgui/apps/gr_spectrogram_plot_c index 52b0d4dff7..a2e63d0113 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_c +++ b/gr-qtgui/apps/gr_spectrogram_plot_c @@ -55,16 +55,15 @@ class spectrogram_plot_c(plot_base.plot_base): def main(): description = "Plots the spectrogram (waterfall) of a list of files. Files are a binary list of complex floats." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = spectrogram_plot_c(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_c(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); main_box = plot_base.plot_spectrogram_form(tb, 'GNU Radio Spectrogram Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_spectrogram_plot_f b/gr-qtgui/apps/gr_spectrogram_plot_f index 6ea5afc4ef..d131747486 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_f +++ b/gr-qtgui/apps/gr_spectrogram_plot_f @@ -55,16 +55,15 @@ class spectrogram_plot_f(plot_base.plot_base): def main(): description = "Plots the spectrogram (waterfall) of a list of files. Files are a binary list of floats." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = spectrogram_plot_f(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_f(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); main_box = plot_base.plot_spectrogram_form(tb, 'GNU Radio Time Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_spectrogram_plot_i b/gr-qtgui/apps/gr_spectrogram_plot_i index 893df2a234..723291d4b4 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_i +++ b/gr-qtgui/apps/gr_spectrogram_plot_i @@ -54,16 +54,15 @@ class spectrogram_plot_i(plot_base.plot_base): def main(): description = "Plots the spectrogram (waterfall) of a list of files. Files are a binary list of ints." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = spectrogram_plot_i(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_i(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); main_box = plot_base.plot_spectrogram_form(tb, 'GNU Radio Time Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_spectrogram_plot_s b/gr-qtgui/apps/gr_spectrogram_plot_s index 82a22f740d..606fbf95e4 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_s +++ b/gr-qtgui/apps/gr_spectrogram_plot_s @@ -54,16 +54,15 @@ class spectrogram_plot_s(plot_base.plot_base): def main(): description = "Plots the spectrogram (waterfall) of a list of files. Files are a binary list of shorts." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = spectrogram_plot_s(filelist, - options.center_frequency, options.sample_rate, - options.psd_size, - options.start, options.nsamples, max_nsamples, - options.average); + tb = spectrogram_plot_s(args.files, + args.center_frequency, args.sample_rate, + args.psd_size, + args.start, args.nsamples, max_nsamples, + args.average); main_box = plot_base.plot_spectrogram_form(tb, 'GNU Radio Time Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_time_plot_b b/gr-qtgui/apps/gr_time_plot_b index d822557f1b..a2f63cc4bf 100755 --- a/gr-qtgui/apps/gr_time_plot_b +++ b/gr-qtgui/apps/gr_time_plot_b @@ -52,14 +52,13 @@ class plot_time_b(plot_base.plot_base): def main(): description = "Plots a list of files on a scope plot. Files are a binary list of chars." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = plot_time_b(filelist, options.sample_rate, - options.start, options.nsamples, max_nsamples, - not options.no_auto_scale) + tb = plot_time_b(args.files, args.sample_rate, + args.start, args.nsamples, max_nsamples, + not args.no_auto_scale) main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_time_plot_c b/gr-qtgui/apps/gr_time_plot_c index 202e0f88f4..3dfccad804 100755 --- a/gr-qtgui/apps/gr_time_plot_c +++ b/gr-qtgui/apps/gr_time_plot_c @@ -54,14 +54,13 @@ class plot_time_c(plot_base.plot_base): def main(): description = "Plots a list of files on a scope plot. Files are a binary list of complex floats." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = plot_time_c(filelist, options.sample_rate, - options.start, options.nsamples, max_nsamples, - not options.no_auto_scale) + tb = plot_time_c(args.files, args.sample_rate, + args.start, args.nsamples, max_nsamples, + not args.no_auto_scale) main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot', 10000.0) main_box.show() diff --git a/gr-qtgui/apps/gr_time_plot_f b/gr-qtgui/apps/gr_time_plot_f index 8f5ad9f60d..59b340de9e 100755 --- a/gr-qtgui/apps/gr_time_plot_f +++ b/gr-qtgui/apps/gr_time_plot_f @@ -53,14 +53,13 @@ class plot_time_f(plot_base.plot_base): def main(): description = "Plots a list of files on a scope plot. Files are a binary list of floats." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = plot_time_f(filelist, options.sample_rate, - options.start, options.nsamples, max_nsamples, - not options.no_auto_scale) + tb = plot_time_f(args.files, args.sample_rate, + args.start, args.nsamples, max_nsamples, + not args.no_auto_scale) main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot', 10000.0) main_box.show() diff --git a/gr-qtgui/apps/gr_time_plot_i b/gr-qtgui/apps/gr_time_plot_i index 8a7888b451..66c0a7f9cf 100755 --- a/gr-qtgui/apps/gr_time_plot_i +++ b/gr-qtgui/apps/gr_time_plot_i @@ -52,14 +52,13 @@ class plot_time_i(plot_base.plot_base): def main(): description = "Plots a list of files on a scope plot. Files are a binary list of integers." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = plot_time_i(filelist, options.sample_rate, - options.start, options.nsamples, max_nsamples, - not options.no_auto_scale) + tb = plot_time_i(args.files, args.sample_rate, + args.start, args.nsamples, max_nsamples, + not args.no_auto_scale) main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_time_plot_s b/gr-qtgui/apps/gr_time_plot_s index 7cee262379..b2e42320db 100755 --- a/gr-qtgui/apps/gr_time_plot_s +++ b/gr-qtgui/apps/gr_time_plot_s @@ -52,14 +52,13 @@ class plot_time_s(plot_base.plot_base): def main(): description = "Plots a list of files on a scope plot. Files are a binary list of shorts." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = plot_time_s(filelist, options.sample_rate, - options.start, options.nsamples, max_nsamples, - not options.no_auto_scale) + tb = plot_time_s(args.files, args.sample_rate, + args.start, args.nsamples, max_nsamples, + not args.no_auto_scale) main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_time_raster_b b/gr-qtgui/apps/gr_time_raster_b index ad8691489c..6cd93b0965 100755 --- a/gr-qtgui/apps/gr_time_raster_b +++ b/gr-qtgui/apps/gr_time_raster_b @@ -56,15 +56,14 @@ class plot_time_raster_b(plot_base.plot_base): def main(): description = "Plots a list of files on a scope plot. Files are a binary list of chars." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = plot_time_raster_b(filelist, options.sample_rate, - options.start, options.nsamples, max_nsamples, - options.nrows, options.ncols, - not options.no_auto_scale) + tb = plot_time_raster_b(args.files, args.sample_rate, + args.start, args.nsamples, max_nsamples, + args.nrows, args.ncols, + not args.no_auto_scale) main_box = plot_base.plot_time_raster_form(tb, 'GNU Radio Time Plot') main_box.show() diff --git a/gr-qtgui/apps/gr_time_raster_f b/gr-qtgui/apps/gr_time_raster_f index 5d6a8389cf..944d739978 100755 --- a/gr-qtgui/apps/gr_time_raster_f +++ b/gr-qtgui/apps/gr_time_raster_f @@ -56,15 +56,14 @@ class plot_time_raster_f(plot_base.plot_base): def main(): description = "Plots a list of files on a scope plot. Files are a binary list of floats." - (options, args) = plot_base.setup_options(description) + args = plot_base.setup_options(description) - filelist = list(args) - max_nsamples = plot_base.find_max_nsamples(filelist) + max_nsamples = plot_base.find_max_nsamples(args.files) - tb = plot_time_raster_f(filelist, options.sample_rate, - options.start, options.nsamples, max_nsamples, - options.nrows, options.ncols, - not options.no_auto_scale) + tb = plot_time_raster_f(args.files, args.sample_rate, + args.start, args.nsamples, max_nsamples, + args.nrows, args.ncols, + not args.no_auto_scale) main_box = plot_base.plot_time_raster_form(tb, 'GNU Radio Time Plot', 10000.0) main_box.show() diff --git a/gr-qtgui/apps/plot_base.py b/gr-qtgui/apps/plot_base.py index eaab7599c7..7a039e2135 100644 --- a/gr-qtgui/apps/plot_base.py +++ b/gr-qtgui/apps/plot_base.py @@ -21,8 +21,6 @@ # from gnuradio import gr, blocks -from gnuradio.eng_option import eng_option -from optparse import OptionParser import os, sys os.environ['GR_CONF_CONTROLPORT_ON'] = 'False' diff --git a/gr-qtgui/apps/plot_psd_base.py b/gr-qtgui/apps/plot_psd_base.py index 46f903e1b5..c3c03ec977 100644 --- a/gr-qtgui/apps/plot_psd_base.py +++ b/gr-qtgui/apps/plot_psd_base.py @@ -21,8 +21,8 @@ # from gnuradio import gr, blocks -from gnuradio.eng_option import eng_option -from optparse import OptionParser +from gnuradio.eng_arg import eng_float, intx +from argparse import ArgumentParser import os, sys try: @@ -141,23 +141,21 @@ class plot_base(gr.top_block): self.start() def setup_options(desc): - parser = OptionParser(option_class=eng_option, description=desc, - conflict_handler="resolve") - parser.add_option("-N", "--nsamples", type="int", default=1000000, + parser = ArgumentParser(description=desc, conflict_handler="resolve") + parser.add_argument("-N", "--nsamples", type=int, default=1000000, help="Set the number of samples to display [default=prints entire file]") - parser.add_option("-S", "--start", type="int", default=0, - help="Starting sample number [default=%default]") - parser.add_option("-L", "--psd-size", type="int", default=2048, - help="Set the FFT size of the PSD [default=%default]") - parser.add_option("-f", "--center-frequency", type="eng_float", default=0.0, - help="Set the center frequency of the signal [default=%default]") - parser.add_option("-r", "--sample-rate", type="eng_float", default=1.0, - help="Set the sample rate of the signal [default=%default]") - parser.add_option("-a", "--average", type="float", default=1.0, - help="Set amount of averaging (smaller=more averaging) [default=%default]") - (options, args) = parser.parse_args() - - if(len(args) < 1): - parser.print_help() - sys.exit(0) - return (options,args) + parser.add_argument("-S", "--start", type=int, default=0, + help="Starting sample number [default=%(default)r]") + parser.add_argument("-L", "--psd-size", type=int, default=2048, + help="Set the FFT size of the PSD [default=%(default)r]") + parser.add_argument("-f", "--center-frequency", type=eng_float, default=0.0, + help="Set the center frequency of the signal [default=%(default)r]") + parser.add_argument("-r", "--sample-rate", type=eng_float, default=1.0, + help="Set the sample rate of the signal [default=%(default)r]") + parser.add_argument("-a", "--average", type=float, default=1.0, + help="Set amount of averaging (smaller=more averaging) [default=%(default)r]") + parser.add_argument("files", nargs='+', metavar='FILE', + help="Complex samples") + args = parser.parse_args() + + return args diff --git a/gr-qtgui/apps/plot_spectrogram_base.py b/gr-qtgui/apps/plot_spectrogram_base.py index b252bb8863..f568100719 100644 --- a/gr-qtgui/apps/plot_spectrogram_base.py +++ b/gr-qtgui/apps/plot_spectrogram_base.py @@ -21,8 +21,8 @@ # from gnuradio import gr, blocks -from gnuradio.eng_option import eng_option -from optparse import OptionParser +from gnuradio.eng_arg import eng_float, intx +from argparse import ArgumentParser import os, sys try: @@ -146,25 +146,22 @@ class plot_base(gr.top_block): self.start() def setup_options(desc): - parser = OptionParser(option_class=eng_option, description=desc, - conflict_handler="resolve") - parser.add_option("-N", "--nsamples", type="int", default=1000000, - help="Set the number of samples to display [default=%default]") - parser.add_option("-S", "--start", type="int", default=0, - help="Starting sample number [default=%default]") - parser.add_option("-L", "--psd-size", type="int", default=2048, - help="Set the FFT size of the PSD [default=%default]") - parser.add_option("-f", "--center-frequency", type="eng_float", default=0.0, - help="Set the center frequency of the signal [default=%default]") - parser.add_option("-r", "--sample-rate", type="eng_float", default=1.0, - help="Set the sample rate of the signal [default=%default]") - parser.add_option("-a", "--average", type="float", default=1.0, - help="Set amount of averaging (smaller=more averaging) [default=%default]") - (options, args) = parser.parse_args() - - if(len(args) < 1): - parser.print_help() - sys.exit(0) - - return (options, args) + parser = ArgumentParser(description=desc, conflict_handler="resolve") + parser.add_argument("-N", "--nsamples", type=int, default=1000000, + help="Set the number of samples to display [default=%(default)r]") + parser.add_argument("-S", "--start", type=int, default=0, + help="Starting sample number [default=%(default)r]") + parser.add_argument("-L", "--psd-size", type=int, default=2048, + help="Set the FFT size of the PSD [default=%(default)r]") + parser.add_argument("-f", "--center-frequency", type=eng_float, default=0.0, + help="Set the center frequency of the signal [default=%(default)r]") + parser.add_argument("-r", "--sample-rate", type=eng_float, default=1.0, + help="Set the sample rate of the signal [default=%(default)r]") + parser.add_argument("-a", "--average", type=float, default=1.0, + help="Set amount of averaging (smaller=more averaging) [default=%(default)r]") + parser.add_argument('files', nargs='+', metavar='FILE', + help="File with complex samples") + args = parser.parse_args() + + return args diff --git a/gr-qtgui/apps/plot_time_base.py b/gr-qtgui/apps/plot_time_base.py index 007c94d044..cfbe5dc6cb 100644 --- a/gr-qtgui/apps/plot_time_base.py +++ b/gr-qtgui/apps/plot_time_base.py @@ -21,8 +21,8 @@ # from gnuradio import gr, blocks -from gnuradio.eng_option import eng_option -from optparse import OptionParser +from gnuradio.eng_arg import eng_float, intx +from argparse import ArgumentParser import os, sys try: @@ -166,19 +166,18 @@ class plot_base(gr.top_block): self._auto_scale = False def setup_options(desc): - parser = OptionParser(option_class=eng_option, description=desc, - conflict_handler="resolve") - parser.add_option("-N", "--nsamples", type="int", default=1000000, - help="Set the number of samples to display [default=%default]") - parser.add_option("-S", "--start", type="int", default=0, - help="Starting sample number [default=%default]") - parser.add_option("-r", "--sample-rate", type="eng_float", default=1.0, - help="Set the sample rate of the signal [default=%default]") - parser.add_option("", "--no-auto-scale", action="store_true", default=False, - help="Do not auto-scale the plot [default=%default]") - (options,args) = parser.parse_args() - if(len(args) < 1): - parser.print_help() - sys.exit(0) - return (options,args) + parser = ArgumentParser(description=desc, conflict_handler="resolve") + parser.add_argument("-N", "--nsamples", type=int, default=1000000, + help="Set the number of samples to display [default=%(default)r]") + parser.add_argument("-S", "--start", type=int, default=0, + help="Starting sample number [default=%(default)r]") + parser.add_argument("-r", "--sample-rate", type=eng_float, default=1.0, + help="Set the sample rate of the signal [default=%(default)r]") + parser.add_argument("--no-auto-scale", action="store_true", + help="Do not auto-scale the plot [default=%(default)r]") + parser.add_argument("files", nargs='+', metavar="FILE", + help="File with complex samples") + args = parser.parse_args() + + return args diff --git a/gr-qtgui/apps/plot_time_raster_base.py b/gr-qtgui/apps/plot_time_raster_base.py index 856c8c8945..e84b84c295 100644 --- a/gr-qtgui/apps/plot_time_raster_base.py +++ b/gr-qtgui/apps/plot_time_raster_base.py @@ -21,8 +21,8 @@ # from gnuradio import gr, blocks -from gnuradio.eng_option import eng_option -from optparse import OptionParser +from gnuradio.eng_arg import eng_float, intx +from argparse import ArgumentParser import os, sys try: @@ -161,23 +161,22 @@ class plot_base(gr.top_block): self._auto_scale = False def setup_options(desc): - parser = OptionParser(option_class=eng_option, description=desc, - conflict_handler="resolve") - parser.add_option("-N", "--nsamples", type="int", default=1000000, - help="Set the number of samples to display [default=%default]") - parser.add_option("-S", "--start", type="int", default=0, - help="Starting sample number [default=%default]") - parser.add_option("-C", "--ncols", type="int", default=100, - help="Number of columns [default=%default]") - parser.add_option("-R", "--nrows", type="int", default=100, - help="Number of rows [default=%default]") - parser.add_option("-r", "--sample-rate", type="eng_float", default=1.0, - help="Set the sample rate of the signal [default=%default]") - parser.add_option("", "--no-auto-scale", action="store_true", default=False, - help="Do not auto-scale the plot [default=%default]") - (options,args) = parser.parse_args() - if(len(args) < 1): - parser.print_help() - sys.exit(0) - return (options,args) + parser = ArgumentParser(description=desc, conflict_handler="resolve") + parser.add_argument("-N", "--nsamples", type=int, default=1000000, + help="Set the number of samples to display [default=%(default)r]") + parser.add_argument("-S", "--start", type=int, default=0, + help="Starting sample number [default=%(default)r]") + parser.add_argument("-C", "--ncols", type=int, default=100, + help="Number of columns [default=%(default)r]") + parser.add_argument("-R", "--nrows", type=int, default=100, + help="Number of rows [default=%(default)r]") + parser.add_argument("-r", "--sample-rate", type=eng_float, default=1.0, + help="Set the sample rate of the signal [default=%(default)r]") + parser.add_argument("--no-auto-scale", action="store_true", + help="Do not auto-scale the plot [default=%(default)r]") + parser.add_argument("files", nargs="+", metavar="FILE", + help="Input files with complex samples") + args = parser.parse_args() + + return args diff --git a/gr-qtgui/examples/CMakeLists.txt b/gr-qtgui/examples/CMakeLists.txt index 5662dfa9c8..a91e374772 100644 --- a/gr-qtgui/examples/CMakeLists.txt +++ b/gr-qtgui/examples/CMakeLists.txt @@ -33,7 +33,6 @@ GR_PYTHON_INSTALL(PROGRAMS pyqt_waterfall_c.py pyqt_waterfall_f.py DESTINATION ${GR_PKG_QTGUI_EXAMPLES_DIR} - COMPONENT "qtgui_python" ) install( @@ -43,5 +42,4 @@ install( qtgui_message_inputs.grc test_qtgui_msg.grc DESTINATION ${GR_PKG_QTGUI_EXAMPLES_DIR} - COMPONENT "qtgui_python" ) diff --git a/gr-qtgui/examples/c++/CMakeLists.txt b/gr-qtgui/examples/c++/CMakeLists.txt index 239b5dbf42..88275196d0 100644 --- a/gr-qtgui/examples/c++/CMakeLists.txt +++ b/gr-qtgui/examples/c++/CMakeLists.txt @@ -35,14 +35,19 @@ list(APPEND QTGUI_LIBRARIES gnuradio-blocks gnuradio-fft gnuradio-runtime + ${QT_LIBRARIES} ) -QT4_WRAP_CPP(qtgui_moc_sources display_qt.h) +if (${DESIRED_QT_VERSION} MATCHES 4) + QT4_WRAP_CPP(qtgui_moc_sources display_qt.h) +else() + QT5_WRAP_CPP(qtgui_moc_sources display_qt.h) +endif() + add_executable(display_qt display_qt.cc ${qtgui_moc_sources}) target_link_libraries(display_qt ${QTGUI_LIBRARIES}) INSTALL(TARGETS display_qt DESTINATION ${GR_PKG_QTGUI_EXAMPLES_DIR} - COMPONENT "qtgui_examples" ) diff --git a/gr-qtgui/examples/pyqt_const_c.py b/gr-qtgui/examples/pyqt_const_c.py index 3a43bf9a92..0bb6c20d59 100755 --- a/gr-qtgui/examples/pyqt_const_c.py +++ b/gr-qtgui/examples/pyqt_const_c.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011,2012 Free Software Foundation, Inc. +# Copyright 2011,2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -44,71 +44,65 @@ except ImportError: sys.stderr.write("Error: Program requires gr-channels.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) + self.quit.clicked.connect(QtWidgets.qApp.quit) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) - def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText("{0}".format(self.signal1.frequency())) + self.amp1Edit.setText("{0}".format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText("{0}".format(self.signal2.frequency())) + self.amp2Edit.setText("{0}".format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -150,7 +144,7 @@ class my_top_block(gr.top_block): npts = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.5, 0) src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.5, 0) @@ -158,6 +152,7 @@ class my_top_block(gr.top_block): channel = channels.channel_model(0.001) thr = blocks.throttle(gr.sizeof_gr_complex, 100*npts) self.snk1 = qtgui.const_sink_c(npts, "Constellation Example", 1) + self.snk1.disable_legend() self.connect(src1, (src,0)) self.connect(src2, (src,1)) @@ -171,8 +166,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) self.main_box = dialog_box(pyWin, self.ctrl_win) self.main_box.show() @@ -182,4 +177,3 @@ if __name__ == "__main__": tb.start() tb.qapp.exec_() tb.stop() - diff --git a/gr-qtgui/examples/pyqt_example_c.py b/gr-qtgui/examples/pyqt_example_c.py index 1bf61d949d..89ca7b2820 100755 --- a/gr-qtgui/examples/pyqt_example_c.py +++ b/gr-qtgui/examples/pyqt_example_c.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011,2012 Free Software Foundation, Inc. +# Copyright 2011,2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -44,71 +44,66 @@ except ImportError: sys.stderr.write("Error: Program requires gr-channels.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText(("{0}").format(self.signal2.frequency())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -150,7 +145,7 @@ class my_top_block(gr.top_block): fftsize = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) ss = open(gr.prefix() + '/share/gnuradio/themes/dark.qss') sstext = ss.read() ss.close() @@ -178,8 +173,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) self.main_box = dialog_box(pyWin, self.ctrl_win) diff --git a/gr-qtgui/examples/pyqt_example_f.py b/gr-qtgui/examples/pyqt_example_f.py index 5bd582d1e1..77a7478aa2 100755 --- a/gr-qtgui/examples/pyqt_example_f.py +++ b/gr-qtgui/examples/pyqt_example_f.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011,2012 Free Software Foundation, Inc. +# Copyright 2011,2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -38,71 +38,66 @@ except ImportError: sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText(("{0}").format(self.signal2.frequency())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -144,7 +139,7 @@ class my_top_block(gr.top_block): fftsize = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) src2 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) @@ -171,8 +166,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) self.main_box = dialog_box(pyWin, self.ctrl_win) diff --git a/gr-qtgui/examples/pyqt_freq_c.py b/gr-qtgui/examples/pyqt_freq_c.py index c53feb93d4..954a078df8 100755 --- a/gr-qtgui/examples/pyqt_freq_c.py +++ b/gr-qtgui/examples/pyqt_freq_c.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2012 Free Software Foundation, Inc. +# Copyright 2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -44,71 +44,66 @@ except ImportError: sys.stderr.write("Error: Program requires gr-channels.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText(("{0}").format(self.signal2.frequency())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -150,7 +145,7 @@ class my_top_block(gr.top_block): npts = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) ss = open(gr.prefix() + '/share/gnuradio/themes/dark.qss') sstext = ss.read() ss.close() @@ -179,8 +174,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) #pyWin.show() self.main_box = dialog_box(pyWin, self.ctrl_win) diff --git a/gr-qtgui/examples/pyqt_freq_f.py b/gr-qtgui/examples/pyqt_freq_f.py index 668b54d249..d7d389b736 100755 --- a/gr-qtgui/examples/pyqt_freq_f.py +++ b/gr-qtgui/examples/pyqt_freq_f.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2012 Free Software Foundation, Inc. +# Copyright 2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -39,71 +39,66 @@ except ImportError: sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText(("{0}").format(self.signal2.frequency())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -145,7 +140,7 @@ class my_top_block(gr.top_block): npts = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) src2 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) @@ -169,8 +164,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) #pyWin.show() self.main_box = dialog_box(pyWin, self.ctrl_win) @@ -181,4 +176,3 @@ if __name__ == "__main__": tb.start() tb.qapp.exec_() tb.stop() - diff --git a/gr-qtgui/examples/pyqt_histogram_f.py b/gr-qtgui/examples/pyqt_histogram_f.py index a960275f41..81f7b9d40b 100755 --- a/gr-qtgui/examples/pyqt_histogram_f.py +++ b/gr-qtgui/examples/pyqt_histogram_f.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2013 Free Software Foundation, Inc. +# Copyright 2013,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -38,87 +38,80 @@ except ImportError: sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, snk, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.snk = snk self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Sine Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Sine Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Noise Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) # Control the histogram - self.hist_npts = QtGui.QLineEdit(self) + self.hist_npts = QtWidgets.QLineEdit(self) self.hist_npts.setMinimumWidth(100) - self.hist_npts.setValidator(QtGui.QIntValidator(0, 8191)) + self.hist_npts.setValidator(Qt.QIntValidator(0, 8191)) self.hist_npts.setText("{0}".format(self.snk.nsamps())) self.layout.addRow("Number of Points:", self.hist_npts) - self.connect(self.hist_npts, QtCore.SIGNAL("editingFinished()"), - self.set_nsamps) + self.hist_npts.editingFinished.connect(self.set_nsamps) - self.hist_bins = QtGui.QLineEdit(self) + self.hist_bins = QtWidgets.QLineEdit(self) self.hist_bins.setMinimumWidth(100) - self.hist_bins.setValidator(QtGui.QIntValidator(0, 1000)) + self.hist_bins.setValidator(Qt.QIntValidator(0, 1000)) self.hist_bins.setText("{0}".format(self.snk.bins())) self.layout.addRow("Number of Bins:", self.hist_bins) - self.connect(self.hist_bins, QtCore.SIGNAL("editingFinished()"), - self.set_bins) + self.hist_bins.editingFinished.connect(self.set_bins) - self.hist_auto = QtGui.QPushButton("scale", self) + self.hist_auto = QtWidgets.QPushButton("scale", self) self.layout.addRow("Autoscale X:", self.hist_auto) - self.connect(self.hist_auto, QtCore.SIGNAL("pressed()"), - self.autoscalex) + self.hist_auto.pressed.connect(self.autoscalex) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -164,7 +157,7 @@ class my_top_block(gr.top_block): npts = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0, 0) src2 = analog.noise_source_f(analog.GR_GAUSSIAN, 1) @@ -172,6 +165,7 @@ class my_top_block(gr.top_block): thr = blocks.throttle(gr.sizeof_float, 100*npts) self.snk1 = qtgui.histogram_sink_f(npts, 200, -5, 5, "Histogram") + self.snk1.disable_legend() self.connect(src1, (src,0)) self.connect(src2, (src,1)) @@ -185,8 +179,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) #pyWin.show() self.main_box = dialog_box(pyWin, self.ctrl_win) @@ -197,4 +191,3 @@ if __name__ == "__main__": tb.start() tb.qapp.exec_() tb.stop() - diff --git a/gr-qtgui/examples/pyqt_time_c.py b/gr-qtgui/examples/pyqt_time_c.py index 0162bb6ffc..b595c8ff85 100755 --- a/gr-qtgui/examples/pyqt_time_c.py +++ b/gr-qtgui/examples/pyqt_time_c.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011,2012 Free Software Foundation, Inc. +# Copyright 2011,2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -44,71 +44,66 @@ except ImportError: sys.stderr.write("Error: Program requires gr-channels.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText(("{0}").format(self.signal2.frequency())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -150,7 +145,7 @@ class my_top_block(gr.top_block): npts = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) ss = open(gr.prefix() + '/share/gnuradio/themes/dark.qss') sstext = ss.read() ss.close() @@ -178,13 +173,14 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) # Example of using signal/slot to set the title of a curve - pyWin.connect(pyWin, QtCore.SIGNAL("setLineLabel(int, QString)"), - pyWin, QtCore.SLOT("setLineLabel(int, QString)")) - pyWin.emit(QtCore.SIGNAL("setLineLabel(int, QString)"), 0, "Re{sum}") + # FIXME: update for Qt5 + #pyWin.setLineLabel.connect(pyWin.setLineLabel) + #pyWin.emit(QtCore.SIGNAL("setLineLabel(int, QString)"), 0, "Re{sum}") + self.snk1.set_line_label(0, "Re{Sum}") self.snk1.set_line_label(1, "Im{Sum}") #self.snk1.set_line_label(2, "Re{src1}") #self.snk1.set_line_label(3, "Im{src1}") diff --git a/gr-qtgui/examples/pyqt_time_f.py b/gr-qtgui/examples/pyqt_time_f.py index b733a5a809..3689ebff54 100755 --- a/gr-qtgui/examples/pyqt_time_f.py +++ b/gr-qtgui/examples/pyqt_time_f.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011,2012 Free Software Foundation, Inc. +# Copyright 2011,2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -38,71 +38,66 @@ except ImportError: sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText(("{0}").format(self.signal2.frequency())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -144,7 +139,7 @@ class my_top_block(gr.top_block): npts = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) src2 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) @@ -171,13 +166,14 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) # Example of using signal/slot to set the title of a curve - pyWin.connect(pyWin, QtCore.SIGNAL("setLineLabel(int, QString)"), - pyWin, QtCore.SLOT("setLineLabel(int, QString)")) - pyWin.emit(QtCore.SIGNAL("setLineLabel(int, QString)"), 0, "sum") + # FIXME: update for Qt5 + #pyWin.setLineLabel.connect(pyWin.setLineLabel) + #pyWin.emit(QtCore.SIGNAL("setLineLabel(int, QString)"), 0, "Re{sum}") + self.snk1.set_line_label(0, "Re{sum}") self.snk1.set_line_label(1, "src1") self.snk1.set_line_label(2, "src2") @@ -193,4 +189,3 @@ if __name__ == "__main__": tb.start() tb.qapp.exec_() tb.stop() - diff --git a/gr-qtgui/examples/pyqt_time_raster_b.py b/gr-qtgui/examples/pyqt_time_raster_b.py index 4cad9de601..7a94400283 100755 --- a/gr-qtgui/examples/pyqt_time_raster_b.py +++ b/gr-qtgui/examples/pyqt_time_raster_b.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2012,2013 Free Software Foundation, Inc. +# Copyright 2012,2013,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -27,18 +27,18 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print "Error: Program requires PyQt5 and gr-qtgui." sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.resize(800, 500) @@ -47,7 +47,7 @@ class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) data0 = 10*[0,] + 40*[1,0] + 10*[0,] data0 += 10*[0,] + 40*[0,1] + 10*[0,] @@ -73,8 +73,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) self.main_box = dialog_box(pyWin) self.main_box.show() @@ -84,4 +84,3 @@ if __name__ == "__main__": tb.start() tb.qapp.exec_() tb.stop() - diff --git a/gr-qtgui/examples/pyqt_time_raster_f.py b/gr-qtgui/examples/pyqt_time_raster_f.py index c5261520db..0f9de94bcb 100755 --- a/gr-qtgui/examples/pyqt_time_raster_f.py +++ b/gr-qtgui/examples/pyqt_time_raster_f.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2012,2013 Free Software Foundation, Inc. +# Copyright 2012,2013,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,18 +26,18 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print "Error: Program requires PyQt5 and gr-qtgui." sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.resize(800, 500) @@ -46,7 +46,7 @@ class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) data0 = 10*[0,] + 40*[1,0] + 10*[0,] data0 += 10*[0,] + 40*[0,1] + 10*[0,] @@ -72,8 +72,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) self.main_box = dialog_box(pyWin) self.main_box.show() @@ -83,4 +83,3 @@ if __name__ == "__main__": tb.start() tb.qapp.exec_() tb.stop() - diff --git a/gr-qtgui/examples/pyqt_waterfall_c.py b/gr-qtgui/examples/pyqt_waterfall_c.py index 8ec62fc1e2..3f7119f97f 100755 --- a/gr-qtgui/examples/pyqt_waterfall_c.py +++ b/gr-qtgui/examples/pyqt_waterfall_c.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2012 Free Software Foundation, Inc. +# Copyright 2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,7 +26,7 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") @@ -44,71 +44,66 @@ except ImportError: sys.stderr.write("Error: Program requires gr-channels.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText(("{0}").format(self.signal2.frequency())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -152,7 +147,7 @@ class my_top_block(gr.top_block): taps = filter.firdes.complex_band_pass_2(1, Rs, 1500, 2500, 100, 60) - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) ss = open(gr.prefix() + '/share/gnuradio/themes/dark.qss') sstext = ss.read() ss.close() @@ -167,6 +162,8 @@ class my_top_block(gr.top_block): self.snk1 = qtgui.waterfall_sink_c(npts, filter.firdes.WIN_BLACKMAN_hARRIS, 0, Rs, "Complex Waterfall Example", 2) + self.snk1.set_color_map(0, qtgui.INTENSITY_COLOR_MAP_TYPE_COOL) + self.snk1.set_color_map(1, qtgui.INTENSITY_COLOR_MAP_TYPE_COOL) self.connect(src1, (src,0)) self.connect(src2, (src,1)) @@ -181,8 +178,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) #pyWin.show() self.main_box = dialog_box(pyWin, self.ctrl_win) diff --git a/gr-qtgui/examples/pyqt_waterfall_f.py b/gr-qtgui/examples/pyqt_waterfall_f.py index f9680c28cf..71c72afad6 100755 --- a/gr-qtgui/examples/pyqt_waterfall_f.py +++ b/gr-qtgui/examples/pyqt_waterfall_f.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2012 Free Software Foundation, Inc. +# Copyright 2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ import sys try: from gnuradio import qtgui - from PyQt4 import QtGui, QtCore + from PyQt5 import QtWidgets, Qt import sip except ImportError: - sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n") sys.exit(1) try: @@ -38,71 +38,66 @@ except ImportError: sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) -class dialog_box(QtGui.QWidget): +class dialog_box(QtWidgets.QWidget): def __init__(self, display, control): - QtGui.QWidget.__init__(self, None) + QtWidgets.QWidget.__init__(self, None) self.setWindowTitle('PyQt Test GUI') - self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) + self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self) self.boxlayout.addWidget(display, 1) self.boxlayout.addWidget(control) self.resize(800, 500) -class control_box(QtGui.QWidget): +class control_box(QtWidgets.QWidget): def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.setWindowTitle('Control Panel') self.setToolTip('Control the signals') - QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10)) + QtWidgets.QToolTip.setFont(Qt.QFont('OldEnglish', 10)) - self.layout = QtGui.QFormLayout(self) + self.layout = QtWidgets.QFormLayout(self) # Control the first signal - self.freq1Edit = QtGui.QLineEdit(self) + self.freq1Edit = QtWidgets.QLineEdit(self) self.freq1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Frequency:", self.freq1Edit) - self.connect(self.freq1Edit, QtCore.SIGNAL("editingFinished()"), - self.freq1EditText) + self.freq1Edit.editingFinished.connect(self.freq1EditText) - self.amp1Edit = QtGui.QLineEdit(self) + self.amp1Edit = QtWidgets.QLineEdit(self) self.amp1Edit.setMinimumWidth(100) self.layout.addRow("Signal 1 Amplitude:", self.amp1Edit) - self.connect(self.amp1Edit, QtCore.SIGNAL("editingFinished()"), - self.amp1EditText) + self.amp1Edit.editingFinished.connect(self.amp1EditText) # Control the second signal - self.freq2Edit = QtGui.QLineEdit(self) + self.freq2Edit = QtWidgets.QLineEdit(self) self.freq2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Frequency:", self.freq2Edit) - self.connect(self.freq2Edit, QtCore.SIGNAL("editingFinished()"), - self.freq2EditText) + self.freq2Edit.editingFinished.connect(self.freq2EditText) - self.amp2Edit = QtGui.QLineEdit(self) + self.amp2Edit = QtWidgets.QLineEdit(self) self.amp2Edit.setMinimumWidth(100) self.layout.addRow("Signal 2 Amplitude:", self.amp2Edit) - self.connect(self.amp2Edit, QtCore.SIGNAL("editingFinished()"), - self.amp2EditText) + self.amp2Edit.editingFinished.connect(self.amp2EditText) - self.quit = QtGui.QPushButton('Close', self) + self.quit = QtWidgets.QPushButton('Close', self) self.quit.setMinimumWidth(100) self.layout.addWidget(self.quit) - self.connect(self.quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + self.quit.clicked.connect(QtWidgets.qApp.quit) def attach_signal1(self, signal): self.signal1 = signal - self.freq1Edit.setText(QtCore.QString("%1").arg(self.signal1.frequency())) - self.amp1Edit.setText(QtCore.QString("%1").arg(self.signal1.amplitude())) + self.freq1Edit.setText(("{0}").format(self.signal1.frequency())) + self.amp1Edit.setText(("{0}").format(self.signal1.amplitude())) def attach_signal2(self, signal): self.signal2 = signal - self.freq2Edit.setText(QtCore.QString("%1").arg(self.signal2.frequency())) - self.amp2Edit.setText(QtCore.QString("%1").arg(self.signal2.amplitude())) + self.freq2Edit.setText(("{0}").format(self.signal2.frequency())) + self.amp2Edit.setText(("{0}").format(self.signal2.amplitude())) def freq1EditText(self): try: @@ -144,7 +139,7 @@ class my_top_block(gr.top_block): npts = 2048 - self.qapp = QtGui.QApplication(sys.argv) + self.qapp = QtWidgets.QApplication(sys.argv) src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) src2 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) @@ -153,6 +148,8 @@ class my_top_block(gr.top_block): self.snk1 = qtgui.waterfall_sink_f(npts, filter.firdes.WIN_BLACKMAN_hARRIS, 0, Rs, "Real Waterfall Example", 2) + self.snk1.set_color_map(0, qtgui.INTENSITY_COLOR_MAP_TYPE_COOL) + self.snk1.set_color_map(1, qtgui.INTENSITY_COLOR_MAP_TYPE_COOL) self.connect(src1, (src,0)) self.connect(src2, (src,1)) @@ -167,8 +164,8 @@ class my_top_block(gr.top_block): pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object - # This can now be manipulated as a PyQt4.QtGui.QWidget - pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) + # This can now be manipulated as a PyQt5.QtWidgets.QWidget + pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget) #pyWin.show() self.main_box = dialog_box(pyWin, self.ctrl_win) @@ -179,4 +176,3 @@ if __name__ == "__main__": tb.start() tb.qapp.exec_() tb.stop() - diff --git a/gr-qtgui/examples/qtgui_tags_viewing.grc b/gr-qtgui/examples/qtgui_tags_viewing.grc index 4c6454537a..635b1e43fa 100644 --- a/gr-qtgui/examples/qtgui_tags_viewing.grc +++ b/gr-qtgui/examples/qtgui_tags_viewing.grc @@ -1,22 +1,23 @@ -<?xml version='1.0' encoding='ASCII'?> +<?xml version='1.0' encoding='utf-8'?> +<?grc format='1' created='3.8.git'?> <flow_graph> <timestamp>Wed Nov 6 11:52:40 2013</timestamp> <block> <key>options</key> <param> - <key>id</key> - <value>qtgui_tags_viewing</value> + <key>author</key> + <value></value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>window_size</key> + <value>1280, 1024</value> </param> <param> - <key>title</key> - <value></value> + <key>category</key> + <value>Custom</value> </param> <param> - <key>author</key> + <key>comment</key> <value></value> </param> <param> @@ -24,16 +25,40 @@ <value></value> </param> <param> - <key>window_size</key> - <value>1280, 1024</value> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> </param> <param> <key>generate_options</key> <value>qt_gui</value> </param> <param> - <key>category</key> - <value>Custom</value> + <key>id</key> + <value>qtgui_tags_viewing</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>qt_qss_theme</key> + <value></value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>run_command</key> + <value>{python} -u {filename}</value> </param> <param> <key>run_options</key> @@ -44,147 +69,349 @@ <value>True</value> </param> <param> - <key>max_nouts</key> - <value>0</value> + <key>thread_safe_setters</key> + <value></value> </param> <param> - <key>realtime_scheduling</key> + <key>title</key> + <value></value> + </param> + </block> + <block> + <key>variable_qtgui_range</key> + <param> + <key>comment</key> <value></value> </param> <param> + <key>value</key> + <value>300</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> <key>_coordinate</key> - <value>(10, 10)</value> + <value>(814, 390)</value> + </param> + <param> + <key>gui_hint</key> + <value></value> </param> <param> <key>_rotation</key> <value>0</value> </param> + <param> + <key>id</key> + <value>delay</value> + </param> + <param> + <key>label</key> + <value>Delay</value> + </param> + <param> + <key>min_len</key> + <value>200</value> + </param> + <param> + <key>orient</key> + <value>Qt.Horizontal</value> + </param> + <param> + <key>start</key> + <value>0</value> + </param> + <param> + <key>step</key> + <value>1</value> + </param> + <param> + <key>stop</key> + <value>1000</value> + </param> + <param> + <key>rangeType</key> + <value>float</value> + </param> + <param> + <key>widget</key> + <value>counter_slider</value> + </param> </block> <block> - <key>variable</key> + <key>variable_qtgui_range</key> <param> - <key>id</key> - <value>samp_rate</value> + <key>comment</key> + <value></value> + </param> + <param> + <key>value</key> + <value>30</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>32000</value> + <key>_coordinate</key> + <value>(936, 392)</value> </param> <param> - <key>_coordinate</key> - <value>(172, 10)</value> + <key>gui_hint</key> + <value></value> </param> <param> <key>_rotation</key> <value>0</value> </param> + <param> + <key>id</key> + <value>ntaps</value> + </param> + <param> + <key>label</key> + <value>Num Taps</value> + </param> + <param> + <key>min_len</key> + <value>200</value> + </param> + <param> + <key>orient</key> + <value>Qt.Horizontal</value> + </param> + <param> + <key>start</key> + <value>1</value> + </param> + <param> + <key>step</key> + <value>1</value> + </param> + <param> + <key>stop</key> + <value>100</value> + </param> + <param> + <key>rangeType</key> + <value>float</value> + </param> + <param> + <key>widget</key> + <value>counter_slider</value> + </param> </block> <block> - <key>import</key> + <key>variable</key> <param> - <key>id</key> - <value>import_1</value> + <key>comment</key> + <value></value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>import</key> - <value>from gnuradio.digital.utils import tagged_streams</value> - </param> - <param> <key>_coordinate</key> - <value>(99, 72)</value> + <value>(172, 10)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>value</key> + <value>32000</value> + </param> </block> <block> - <key>import</key> + <key>analog_fastnoise_source_x</key> <param> - <key>id</key> - <value>import_0</value> + <key>amp</key> + <value>0.004</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>alias</key> + <value></value> </param> <param> - <key>import</key> - <value>import scipy</value> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(9, 71)</value> + <value>(350, 39)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> + <param> + <key>id</key> + <value>analog_fastnoise_source_x_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>seed</key> + <value>0</value> + </param> + <param> + <key>samples</key> + <value>8192</value> + </param> </block> <block> - <key>import</key> + <key>blocks_add_xx</key> <param> - <key>id</key> - <value>import_2</value> + <key>alias</key> + <value></value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>comment</key> + <value></value> </param> <param> - <key>import</key> - <value>import time</value> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(253, 71)</value> + <value>(482, 193)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> + <param> + <key>id</key> + <value>blocks_add_xx_0</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> </block> <block> - <key>blocks_delay</key> + <key>blocks_add_xx</key> <param> - <key>id</key> - <value>blocks_delay_0</value> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> + <key>_coordinate</key> + <value>(707, 176)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>id</key> + <value>blocks_add_xx_1</value> + </param> + <param> <key>type</key> <value>complex</value> </param> <param> - <key>delay</key> - <value>1000</value> + <key>maxoutbuf</key> + <value>0</value> </param> <param> - <key>num_ports</key> - <value>1</value> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> </param> <param> <key>vlen</key> <value>1</value> </param> + </block> + <block> + <key>blocks_delay</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> <param> <key>affinity</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>delay</key> + <value>1000</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> @@ -194,40 +421,103 @@ <key>_rotation</key> <value>0</value> </param> + <param> + <key>id</key> + <value>blocks_delay_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> </block> <block> - <key>blocks_tags_strobe</key> + <key>blocks_delay</key> <param> - <key>id</key> - <value>blocks_tags_strobe_0</value> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>delay</key> + <value>int(delay)</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>_coordinate</key> + <value>(890, 44)</value> </param> <param> - <key>value</key> - <value>pmt.intern("TEST")</value> + <key>_rotation</key> + <value>0</value> </param> <param> - <key>nsamps</key> - <value>10000</value> + <key>id</key> + <value>blocks_delay_0_0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>type</key> + <value>complex</value> </param> <param> <key>vlen</key> <value>1</value> </param> + </block> + <block> + <key>blocks_tags_strobe</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> <param> <key>affinity</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> @@ -237,426 +527,836 @@ <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>analog_fastnoise_source_x</key> <param> <key>id</key> - <value>analog_fastnoise_source_x_0</value> + <value>blocks_tags_strobe_0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>key</key> + <value>pmt.intern("strobe")</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>nsamps</key> + <value>10000</value> </param> <param> <key>type</key> <value>complex</value> </param> <param> - <key>noise_type</key> - <value>analog.GR_GAUSSIAN</value> + <key>value</key> + <value>pmt.intern("TEST")</value> </param> <param> - <key>amp</key> - <value>0.004</value> + <key>vlen</key> + <value>1</value> </param> + </block> + <block> + <key>blocks_throttle</key> <param> - <key>seed</key> - <value>0</value> + <key>alias</key> + <value></value> </param> <param> - <key>samples</key> - <value>8192</value> + <key>comment</key> + <value></value> </param> <param> <key>affinity</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(350, 39)</value> + <value>(266, 149)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>blocks_vector_source_x</key> <param> <key>id</key> - <value>blocks_vector_source_x_0</value> + <value>blocks_throttle_0</value> </param> <param> - <key>_enabled</key> + <key>ignoretag</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>maxoutbuf</key> + <value>0</value> </param> <param> - <key>vector</key> - <value>[0.85+0.5j, 0.85, 0.85, 0.85+0.5j] + (10000-4)*[0,]</value> + <key>minoutbuf</key> + <value>0</value> </param> <param> - <key>tags</key> - <value>tagged_streams.make_lengthtags((1024,), (0,), "testing tags 0")</value> + <key>samples_per_second</key> + <value>50e3</value> </param> <param> - <key>repeat</key> - <value>True</value> + <key>type</key> + <value>complex</value> </param> <param> <key>vlen</key> <value>1</value> </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> <param> <key>affinity</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>_enabled</key> + <value>False</value> </param> <param> <key>_coordinate</key> - <value>(13, 132)</value> + <value>(267, 414)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>blocks_add_xx</key> <param> <key>id</key> - <value>blocks_add_xx_0</value> + <value>blocks_throttle_0_0</value> </param> <param> - <key>_enabled</key> + <key>ignoretag</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>maxoutbuf</key> + <value>0</value> </param> <param> - <key>num_inputs</key> - <value>2</value> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>type</key> + <value>float</value> </param> <param> <key>vlen</key> <value>1</value> </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> <param> <key>affinity</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(482, 193)</value> + <value>(13, 132)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>blocks_add_xx</key> <param> <key>id</key> - <value>blocks_add_xx_1</value> + <value>blocks_vector_source_x_0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> </param> <param> <key>type</key> <value>complex</value> </param> <param> - <key>num_inputs</key> - <value>2</value> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>tags</key> + <value>tagged_streams.make_lengthtags((1024,), (0,), "testing tags 0")</value> </param> <param> <key>vlen</key> <value>1</value> </param> <param> + <key>vector</key> + <value>[0.85+0.5j, 0.85, 0.85, 0.85+0.5j] + (10000-4)*[0,]</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> <key>affinity</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(707, 176)</value> + <value>(15, 315)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>blocks_throttle</key> <param> <key>id</key> - <value>blocks_throttle_0</value> + <value>blocks_vector_source_x_0_0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> </param> <param> <key>type</key> <value>complex</value> </param> <param> - <key>samples_per_second</key> - <value>50e3</value> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>tags</key> + <value>tagged_streams.make_lengthtags((128,), (1500,), "second stream")</value> </param> <param> <key>vlen</key> <value>1</value> </param> <param> + <key>vector</key> + <value>1500*[0,] + [0.25+0j,] + (10000-1500-1)*[0,]</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> <key>affinity</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>_enabled</key> + <value>False</value> </param> <param> <key>_coordinate</key> - <value>(266, 149)</value> + <value>(15, 489)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>variable_qtgui_range</key> <param> <key>id</key> - <value>ntaps</value> + <value>blocks_vector_source_x_0_0_0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>maxoutbuf</key> + <value>0</value> </param> <param> - <key>label</key> - <value>Num Taps</value> + <key>minoutbuf</key> + <value>0</value> </param> <param> - <key>value</key> - <value>30</value> + <key>type</key> + <value>float</value> </param> <param> - <key>start</key> - <value>1</value> + <key>repeat</key> + <value>True</value> </param> <param> - <key>stop</key> - <value>100</value> + <key>tags</key> + <value>tagged_streams.make_lengthtags((128,), (110,), "second stream")</value> </param> <param> - <key>step</key> + <key>vlen</key> <value>1</value> </param> <param> - <key>widget</key> - <value>counter_slider</value> + <key>vector</key> + <value>10*[0,] + [0.5,] + (100-10-1)*[0,]</value> </param> + </block> + <block> + <key>blocks_vector_source_x</key> <param> - <key>orient</key> - <value>Qt.Horizontal</value> + <key>alias</key> + <value></value> </param> <param> - <key>min_len</key> - <value>200</value> + <key>comment</key> + <value></value> </param> <param> - <key>gui_hint</key> + <key>affinity</key> <value></value> </param> <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> <key>_coordinate</key> - <value>(936, 392)</value> + <value>(15, 398)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>qtgui_time_sink_x</key> <param> <key>id</key> - <value>qtgui_time_sink_x_0_1_0</value> + <value>blocks_vector_source_x_0_1</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> </param> <param> <key>type</key> - <value>complex</value> + <value>float</value> </param> <param> - <key>name</key> - <value></value> + <key>repeat</key> + <value>True</value> </param> <param> - <key>size</key> - <value>5100</value> + <key>tags</key> + <value>tagged_streams.make_lengthtags((1024,), (0,), "testing tags")</value> </param> <param> - <key>srate</key> - <value>samp_rate</value> + <key>vlen</key> + <value>1</value> </param> <param> - <key>ymin</key> - <value>-0.1</value> + <key>vector</key> + <value>[-0.85,] + (100-1)*[0,]</value> </param> + </block> + <block> + <key>fir_filter_xxx</key> <param> - <key>ymax</key> - <value>1.5</value> + <key>alias</key> + <value></value> </param> <param> - <key>nconnections</key> + <key>comment</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>decim</key> <value>1</value> </param> <param> - <key>update_time</key> - <value>0.001</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>tr_mode</key> - <value>qtgui.TRIG_MODE_TAG</value> + <key>_coordinate</key> + <value>(660, 76)</value> </param> <param> - <key>tr_slope</key> - <value>qtgui.TRIG_SLOPE_POS</value> + <key>_rotation</key> + <value>0</value> </param> <param> - <key>tr_level</key> - <value>.5</value> + <key>id</key> + <value>fir_filter_xxx_0</value> </param> <param> - <key>tr_delay</key> - <value>0.06</value> + <key>maxoutbuf</key> + <value>0</value> </param> <param> - <key>tr_chan</key> + <key>minoutbuf</key> <value>0</value> </param> <param> - <key>tr_tag</key> - <value>strobe</value> + <key>samp_delay</key> + <value>int(ntaps)</value> </param> <param> - <key>entags</key> - <value>True</value> + <key>taps</key> + <value>int(ntaps)*[1,]+[1,]</value> </param> <param> - <key>gui_hint</key> - <value>1,1,1,1</value> + <key>type</key> + <value>ccc</value> </param> + </block> + <block> + <key>import</key> <param> - <key>affinity</key> + <key>alias</key> <value></value> </param> <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> <key>_coordinate</key> - <value>(857, 173)</value> + <value>(9, 71)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> + <param> + <key>id</key> + <value>import_0</value> + </param> + <param> + <key>import</key> + <value>import scipy</value> + </param> </block> <block> - <key>blocks_vector_source_x</key> + <key>import</key> <param> - <key>id</key> - <value>blocks_vector_source_x_0_0</value> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>_coordinate</key> + <value>(99, 72)</value> </param> <param> - <key>vector</key> - <value>1500*[0,] + [0.25+0j,] + (10000-1500-1)*[0,]</value> + <key>_rotation</key> + <value>0</value> </param> <param> - <key>tags</key> - <value>tagged_streams.make_lengthtags((128,), (1500,), "second stream")</value> + <key>id</key> + <value>import_1</value> </param> <param> - <key>repeat</key> - <value>True</value> + <key>import</key> + <value>from gnuradio.digital.utils import tagged_streams</value> </param> + </block> + <block> + <key>import</key> <param> - <key>vlen</key> - <value>1</value> + <key>alias</key> + <value></value> </param> <param> - <key>affinity</key> + <key>comment</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(15, 315)</value> + <value>(253, 71)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> + <param> + <key>id</key> + <value>import_2</value> + </param> + <param> + <key>import</key> + <value>import time</value> + </param> </block> <block> <key>qtgui_time_sink_x</key> <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>ctrlpanel</key> + <value>False</value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(860, 298)</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <param> + <key>grid</key> + <value>False</value> + </param> + <param> <key>id</key> <value>qtgui_time_sink_x_0</value> </param> <param> - <key>_enabled</key> + <key>legend</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>label1</key> + <value></value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>alpha2</key> + <value>1.0</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>label2</key> + <value></value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>width9</key> + <value>1</value> </param> <param> <key>name</key> <value></value> </param> <param> + <key>nconnections</key> + <value>2</value> + </param> + <param> <key>size</key> <value>18000</value> </param> @@ -665,20 +1365,16 @@ <value>samp_rate</value> </param> <param> - <key>ymin</key> - <value>-0.1</value> - </param> - <param> - <key>ymax</key> - <value>1.5</value> + <key>tr_chan</key> + <value>0</value> </param> <param> - <key>nconnections</key> - <value>2</value> + <key>tr_delay</key> + <value>0</value> </param> <param> - <key>update_time</key> - <value>0.10</value> + <key>tr_level</key> + <value>0.1</value> </param> <param> <key>tr_mode</key> @@ -689,509 +1385,1112 @@ <value>qtgui.TRIG_SLOPE_POS</value> </param> <param> - <key>tr_level</key> - <value>0.1</value> + <key>tr_tag</key> + <value>""</value> </param> <param> - <key>tr_delay</key> - <value>0</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>tr_chan</key> - <value>0</value> + <key>update_time</key> + <value>0.10</value> </param> <param> - <key>tr_tag</key> + <key>ylabel</key> + <value>Amplitude</value> + </param> + <param> + <key>yunit</key> <value>""</value> </param> <param> - <key>entags</key> - <value>True</value> + <key>ymax</key> + <value>1.5</value> </param> <param> - <key>gui_hint</key> + <key>ymin</key> + <value>-0.1</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> <value></value> </param> <param> + <key>ctrlpanel</key> + <value>False</value> + </param> + <param> <key>affinity</key> <value></value> </param> <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> <key>_coordinate</key> - <value>(860, 298)</value> + <value>(475, 444)</value> + </param> + <param> + <key>gui_hint</key> + <value></value> </param> <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>fir_filter_xxx</key> + <param> + <key>grid</key> + <value>False</value> + </param> <param> <key>id</key> - <value>fir_filter_xxx_0</value> + <value>qtgui_time_sink_x_0_0</value> </param> <param> - <key>_enabled</key> + <key>legend</key> <value>True</value> </param> <param> - <key>type</key> - <value>ccc</value> + <key>alpha1</key> + <value>1.0</value> </param> <param> - <key>decim</key> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>label1</key> + <value></value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>style1</key> <value>1</value> </param> <param> - <key>taps</key> - <value>int(ntaps)*[1,]+[1,]</value> + <key>width1</key> + <value>1</value> </param> <param> - <key>samp_delay</key> - <value>int(ntaps)</value> + <key>alpha10</key> + <value>1.0</value> </param> <param> - <key>affinity</key> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>label10</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>marker10</key> + <value>-1</value> </param> <param> - <key>_coordinate</key> - <value>(660, 76)</value> + <key>style10</key> + <value>1</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>width10</key> + <value>1</value> </param> - </block> - <block> - <key>qtgui_time_sink_x</key> <param> - <key>id</key> - <value>qtgui_time_sink_x_0_1</value> + <key>alpha2</key> + <value>1.0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>color2</key> + <value>"red"</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>label2</key> + <value></value> </param> <param> - <key>name</key> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>label3</key> <value></value> </param> <param> - <key>size</key> - <value>1000</value> + <key>marker3</key> + <value>-1</value> </param> <param> - <key>srate</key> - <value>samp_rate</value> + <key>style3</key> + <value>1</value> </param> <param> - <key>ymin</key> - <value>-0.1</value> + <key>width3</key> + <value>1</value> </param> <param> - <key>ymax</key> - <value>4.5</value> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>name</key> + <value></value> </param> <param> <key>nconnections</key> <value>2</value> </param> <param> - <key>update_time</key> - <value>0.10</value> + <key>size</key> + <value>1024</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>tr_chan</key> + <value>1</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> </param> <param> <key>tr_mode</key> - <value>qtgui.TRIG_MODE_NORM</value> + <value>qtgui.TRIG_MODE_TAG</value> </param> <param> <key>tr_slope</key> <value>qtgui.TRIG_SLOPE_POS</value> </param> <param> - <key>tr_level</key> - <value>.1</value> + <key>tr_tag</key> + <value>second stream</value> </param> <param> - <key>tr_delay</key> - <value>0.015</value> + <key>type</key> + <value>float</value> </param> <param> - <key>tr_chan</key> - <value>0</value> + <key>update_time</key> + <value>0.10</value> </param> <param> - <key>tr_tag</key> + <key>ylabel</key> + <value>Amplitude</value> + </param> + <param> + <key>yunit</key> <value>""</value> </param> <param> - <key>entags</key> - <value>True</value> + <key>ymax</key> + <value>1</value> </param> <param> - <key>gui_hint</key> - <value>1,0,1,1</value> + <key>ymin</key> + <value>-1</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>ctrlpanel</key> + <value>False</value> </param> <param> <key>affinity</key> <value></value> </param> <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> <key>_coordinate</key> <value>(1072, 77)</value> </param> <param> + <key>gui_hint</key> + <value>1,0,1,1</value> + </param> + <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>qtgui_time_sink_x</key> + <param> + <key>grid</key> + <value>False</value> + </param> <param> <key>id</key> - <value>qtgui_time_sink_x_0_0</value> + <value>qtgui_time_sink_x_0_1</value> </param> <param> - <key>_enabled</key> - <value>False</value> + <key>legend</key> + <value>True</value> </param> <param> - <key>type</key> - <value>float</value> + <key>alpha1</key> + <value>1.0</value> </param> <param> - <key>name</key> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>label1</key> <value></value> </param> <param> - <key>size</key> - <value>1024</value> + <key>marker1</key> + <value>-1</value> </param> <param> - <key>srate</key> - <value>samp_rate</value> + <key>style1</key> + <value>1</value> </param> <param> - <key>ymin</key> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>marker10</key> <value>-1</value> </param> <param> - <key>ymax</key> + <key>style10</key> <value>1</value> </param> <param> - <key>nconnections</key> - <value>2</value> + <key>width10</key> + <value>1</value> </param> <param> - <key>update_time</key> - <value>0.10</value> + <key>alpha2</key> + <value>1.0</value> </param> <param> - <key>tr_mode</key> - <value>qtgui.TRIG_MODE_TAG</value> + <key>color2</key> + <value>"red"</value> </param> <param> - <key>tr_slope</key> - <value>qtgui.TRIG_SLOPE_POS</value> + <key>label2</key> + <value></value> </param> <param> - <key>tr_level</key> - <value>0.0</value> + <key>marker2</key> + <value>-1</value> </param> <param> - <key>tr_delay</key> - <value>0</value> + <key>style2</key> + <value>1</value> </param> <param> - <key>tr_chan</key> + <key>width2</key> <value>1</value> </param> <param> - <key>tr_tag</key> - <value>second stream</value> + <key>alpha3</key> + <value>1.0</value> </param> <param> - <key>entags</key> - <value>True</value> + <key>color3</key> + <value>"green"</value> </param> <param> - <key>gui_hint</key> + <key>label3</key> <value></value> </param> <param> - <key>affinity</key> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>label4</key> <value></value> </param> <param> - <key>_coordinate</key> - <value>(475, 444)</value> + <key>marker4</key> + <value>-1</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>style4</key> + <value>1</value> </param> - </block> - <block> - <key>blocks_vector_source_x</key> <param> - <key>id</key> - <value>blocks_vector_source_x_0_0_0</value> + <key>width4</key> + <value>1</value> </param> <param> - <key>_enabled</key> - <value>False</value> + <key>alpha5</key> + <value>1.0</value> </param> <param> - <key>type</key> - <value>float</value> + <key>color5</key> + <value>"cyan"</value> </param> <param> - <key>vector</key> - <value>10*[0,] + [0.5,] + (100-10-1)*[0,]</value> + <key>label5</key> + <value></value> </param> <param> - <key>tags</key> - <value>tagged_streams.make_lengthtags((128,), (110,), "second stream")</value> + <key>marker5</key> + <value>-1</value> </param> <param> - <key>repeat</key> - <value>True</value> + <key>style5</key> + <value>1</value> </param> <param> - <key>vlen</key> + <key>width5</key> <value>1</value> </param> <param> - <key>affinity</key> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>label6</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>marker6</key> + <value>-1</value> </param> <param> - <key>_coordinate</key> - <value>(15, 489)</value> + <key>style6</key> + <value>1</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>width6</key> + <value>1</value> </param> - </block> - <block> - <key>blocks_vector_source_x</key> <param> - <key>id</key> - <value>blocks_vector_source_x_0_1</value> + <key>alpha7</key> + <value>1.0</value> </param> <param> - <key>_enabled</key> - <value>False</value> + <key>color7</key> + <value>"yellow"</value> </param> <param> - <key>type</key> - <value>float</value> + <key>label7</key> + <value></value> </param> <param> - <key>vector</key> - <value>[-0.85,] + (100-1)*[0,]</value> + <key>marker7</key> + <value>-1</value> </param> <param> - <key>tags</key> - <value>tagged_streams.make_lengthtags((1024,), (0,), "testing tags")</value> + <key>style7</key> + <value>1</value> </param> <param> - <key>repeat</key> - <value>True</value> + <key>width7</key> + <value>1</value> </param> <param> - <key>vlen</key> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>style8</key> <value>1</value> </param> <param> - <key>affinity</key> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>label9</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>marker9</key> + <value>-1</value> </param> <param> - <key>_coordinate</key> - <value>(15, 398)</value> + <key>style9</key> + <value>1</value> </param> <param> - <key>_rotation</key> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>nconnections</key> + <value>2</value> + </param> + <param> + <key>size</key> + <value>1000</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>tr_chan</key> <value>0</value> </param> - </block> - <block> - <key>blocks_throttle</key> <param> - <key>id</key> - <value>blocks_throttle_0_0</value> + <key>tr_delay</key> + <value>0.015</value> </param> <param> - <key>_enabled</key> - <value>False</value> + <key>tr_level</key> + <value>.1</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_NORM</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> </param> <param> <key>type</key> - <value>float</value> + <value>complex</value> </param> <param> - <key>samples_per_second</key> - <value>samp_rate</value> + <key>update_time</key> + <value>0.10</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>ylabel</key> + <value>Amplitude</value> + </param> + <param> + <key>yunit</key> + <value>""</value> + </param> + <param> + <key>ymax</key> + <value>4.5</value> + </param> + <param> + <key>ymin</key> + <value>-0.1</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>comment</key> + <value></value> + </param> + <param> + <key>ctrlpanel</key> + <value>False</value> </param> <param> <key>affinity</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(267, 414)</value> + <value>(857, 173)</value> + </param> + <param> + <key>gui_hint</key> + <value>1,1,1,1</value> </param> <param> <key>_rotation</key> <value>0</value> </param> - </block> - <block> - <key>blocks_delay</key> + <param> + <key>grid</key> + <value>False</value> + </param> <param> <key>id</key> - <value>blocks_delay_0_0</value> + <value>qtgui_time_sink_x_0_1_0</value> </param> <param> - <key>_enabled</key> + <key>legend</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>alpha1</key> + <value>1.0</value> </param> <param> - <key>delay</key> - <value>int(delay)</value> + <key>color1</key> + <value>"blue"</value> </param> <param> - <key>num_ports</key> + <key>label1</key> + <value></value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>style1</key> <value>1</value> </param> <param> - <key>vlen</key> + <key>width1</key> <value>1</value> </param> <param> - <key>affinity</key> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>label10</key> <value></value> </param> <param> - <key>minoutbuf</key> - <value>0</value> + <key>marker10</key> + <value>-1</value> </param> <param> - <key>_coordinate</key> - <value>(890, 44)</value> + <key>style10</key> + <value>1</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>width10</key> + <value>1</value> </param> - </block> - <block> - <key>variable_qtgui_range</key> <param> - <key>id</key> - <value>delay</value> + <key>alpha2</key> + <value>1.0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>color2</key> + <value>"red"</value> </param> <param> - <key>label</key> - <value>Delay</value> + <key>label2</key> + <value></value> </param> <param> - <key>value</key> - <value>300</value> + <key>marker2</key> + <value>-1</value> </param> <param> - <key>start</key> - <value>0</value> + <key>style2</key> + <value>1</value> </param> <param> - <key>stop</key> - <value>1000</value> + <key>width2</key> + <value>1</value> </param> <param> - <key>step</key> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>style3</key> <value>1</value> </param> <param> - <key>widget</key> - <value>counter_slider</value> + <key>width3</key> + <value>1</value> </param> <param> - <key>orient</key> - <value>Qt.Horizontal</value> + <key>alpha4</key> + <value>1.0</value> </param> <param> - <key>min_len</key> - <value>200</value> + <key>color4</key> + <value>"black"</value> </param> <param> - <key>gui_hint</key> + <key>label4</key> <value></value> </param> <param> - <key>_coordinate</key> - <value>(814, 390)</value> + <key>marker4</key> + <value>-1</value> </param> <param> - <key>_rotation</key> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>size</key> + <value>5100</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>tr_chan</key> <value>0</value> </param> + <param> + <key>tr_delay</key> + <value>0.06</value> + </param> + <param> + <key>tr_level</key> + <value>.5</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_TAG</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_tag</key> + <value>strobe</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>update_time</key> + <value>0.001</value> + </param> + <param> + <key>ylabel</key> + <value>Amplitude</value> + </param> + <param> + <key>yunit</key> + <value>""</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>ymin</key> + <value>-0.1</value> + </param> </block> <connection> - <source_block_id>blocks_vector_source_x_0</source_block_id> - <sink_block_id>blocks_throttle_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_throttle_0</source_block_id> - <sink_block_id>blocks_add_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_delay_0</source_block_id> - <sink_block_id>blocks_add_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>1</sink_key> - </connection> - <connection> <source_block_id>analog_fastnoise_source_x_0</source_block_id> <sink_block_id>blocks_add_xx_1</sink_block_id> <source_key>0</source_key> @@ -1210,28 +2509,28 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>fir_filter_xxx_0</source_block_id> - <sink_block_id>blocks_delay_0_0</sink_block_id> + <source_block_id>blocks_add_xx_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>blocks_delay_0_0</source_block_id> - <sink_block_id>qtgui_time_sink_x_0_1</sink_block_id> + <source_block_id>blocks_add_xx_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_1_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>fir_filter_xxx_0</source_block_id> - <sink_block_id>qtgui_time_sink_x_0_1</sink_block_id> + <source_block_id>blocks_delay_0</source_block_id> + <sink_block_id>blocks_add_xx_0</sink_block_id> <source_key>0</source_key> <sink_key>1</sink_key> </connection> <connection> - <source_block_id>blocks_vector_source_x_0_0</source_block_id> - <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_block_id>blocks_delay_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_1</sink_block_id> <source_key>0</source_key> - <sink_key>1</sink_key> + <sink_key>0</sink_key> </connection> <connection> <source_block_id>blocks_tags_strobe_0</source_block_id> @@ -1240,28 +2539,34 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>blocks_add_xx_1</source_block_id> - <sink_block_id>qtgui_time_sink_x_0_1_0</sink_block_id> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_add_xx_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>blocks_add_xx_1</source_block_id> - <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_block_id>blocks_throttle_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>blocks_vector_source_x_0_0_0</source_block_id> - <sink_block_id>qtgui_time_sink_x_0_0</sink_block_id> + <source_block_id>blocks_vector_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_vector_source_x_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> <source_key>0</source_key> <sink_key>1</sink_key> </connection> <connection> - <source_block_id>blocks_throttle_0_0</source_block_id> + <source_block_id>blocks_vector_source_x_0_0_0</source_block_id> <sink_block_id>qtgui_time_sink_x_0_0</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>1</sink_key> </connection> <connection> <source_block_id>blocks_vector_source_x_0_1</source_block_id> @@ -1269,4 +2574,16 @@ <source_key>0</source_key> <sink_key>0</sink_key> </connection> + <connection> + <source_block_id>fir_filter_xxx_0</source_block_id> + <sink_block_id>blocks_delay_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fir_filter_xxx_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> </flow_graph> diff --git a/gr-qtgui/grc/CMakeLists.txt b/gr-qtgui/grc/CMakeLists.txt index d56158ac70..74e6958639 100644 --- a/gr-qtgui/grc/CMakeLists.txt +++ b/gr-qtgui/grc/CMakeLists.txt @@ -19,4 +19,29 @@ ######################################################################## file(GLOB xml_files "*.xml") -install(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "qtgui_python") + +macro(REPLACE_IN_FILE _xml_block match replace) + set(xml_block_src "${CMAKE_CURRENT_SOURCE_DIR}/${_xml_block}") + set(xml_block "${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}") + + list(REMOVE_ITEM xml_files "${xml_block_src}") + file(READ "${xml_block_src}" xml_block_src_text) + string(REPLACE "${match}" "${replace}" + xml_block_text "${xml_block_src_text}") + file(WRITE "${xml_block}" "${xml_block_text}") + + list(APPEND generated_xml_files "${xml_block}") +endmacro() + + +if(DESIRED_QT_VERSION EQUAL 4) + foreach(xml_block_src ${xml_files}) + get_filename_component(xml_block "${xml_block_src}" NAME) + REPLACE_IN_FILE("${xml_block}" "PyQt5" "PyQt4") + endforeach() +endif() + +install( + FILES ${xml_files} ${generated_xml_files} + DESTINATION "${GRC_BLOCKS_DIR}" +) diff --git a/gr-qtgui/grc/qtgui_ber_sink_b.xml b/gr-qtgui/grc/qtgui_ber_sink_b.xml index da3fc6ebf8..05a36dfbc0 100644 --- a/gr-qtgui/grc/qtgui_ber_sink_b.xml +++ b/gr-qtgui/grc/qtgui_ber_sink_b.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Bercurve Sink</name> <key>qtgui_bercurve_sink</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5import Qt</import> <import>from gnuradio import qtgui</import> <import>import sip</import> <import>import numpy</import> diff --git a/gr-qtgui/grc/qtgui_check_box.xml b/gr-qtgui/grc/qtgui_check_box.xml index 67c8848a22..ccee59dd92 100644 --- a/gr-qtgui/grc/qtgui_check_box.xml +++ b/gr-qtgui/grc/qtgui_check_box.xml @@ -8,7 +8,7 @@ <block> <name>QT GUI Check Box</name> <key>variable_qtgui_check_box</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $win = '_%s_check_box'%$id #if not $label() diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml index f018354dd4..f79bb8ccb3 100644 --- a/gr-qtgui/grc/qtgui_chooser.xml +++ b/gr-qtgui/grc/qtgui_chooser.xml @@ -8,8 +8,8 @@ <block> <name>QT GUI Chooser</name> <key>variable_qtgui_chooser</key> - <import>from PyQt4 import Qt</import> - <import>from PyQt4.QtCore import QObject, pyqtSlot</import> + <import>from PyQt5 import Qt</import> + <import>from PyQt5.QtCore import QObject, pyqtSlot</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#slurp #set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] diff --git a/gr-qtgui/grc/qtgui_const_sink_x.xml b/gr-qtgui/grc/qtgui_const_sink_x.xml index 755f12f964..10f82cce82 100644 --- a/gr-qtgui/grc/qtgui_const_sink_x.xml +++ b/gr-qtgui/grc/qtgui_const_sink_x.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Constellation Sink</name> <key>qtgui_const_sink_x</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>import sip</import> <make>#set $win = 'self._%s_win'%$id diff --git a/gr-qtgui/grc/qtgui_edit_box_msg.xml b/gr-qtgui/grc/qtgui_edit_box_msg.xml index c7c758a612..d77a4b3e1b 100644 --- a/gr-qtgui/grc/qtgui_edit_box_msg.xml +++ b/gr-qtgui/grc/qtgui_edit_box_msg.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Message Edit Box</name> <key>qtgui_edit_box_msg</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>import sip</import> <make>#set $win = 'self._%s_win'%$id diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml index cce2edb4b2..fc0f4089d1 100644 --- a/gr-qtgui/grc/qtgui_entry.xml +++ b/gr-qtgui/grc/qtgui_entry.xml @@ -8,7 +8,7 @@ <block> <name>QT GUI Entry</name> <key>variable_qtgui_entry</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import eng_notation</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $win = 'self._%s_tool_bar'%$id diff --git a/gr-qtgui/grc/qtgui_freq_sink_x.xml b/gr-qtgui/grc/qtgui_freq_sink_x.xml index 009a184327..ed39db7781 100644 --- a/gr-qtgui/grc/qtgui_freq_sink_x.xml +++ b/gr-qtgui/grc/qtgui_freq_sink_x.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Frequency Sink</name> <key>qtgui_freq_sink_x</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>from gnuradio.filter import firdes</import> <import>import sip</import> diff --git a/gr-qtgui/grc/qtgui_histogram_sink_x.xml b/gr-qtgui/grc/qtgui_histogram_sink_x.xml index a789d2e4fa..9e3dcb104f 100644 --- a/gr-qtgui/grc/qtgui_histogram_sink_x.xml +++ b/gr-qtgui/grc/qtgui_histogram_sink_x.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Histogram Sink</name> <key>qtgui_histogram_sink_x</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>import sip</import> <make>#set $win = 'self._%s_win'%$id diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml index 0d844a1ab4..18d4e3a0db 100644 --- a/gr-qtgui/grc/qtgui_label.xml +++ b/gr-qtgui/grc/qtgui_label.xml @@ -9,7 +9,7 @@ <block> <name>QT GUI Label</name> <key>variable_qtgui_label</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import eng_notation</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $win = 'self._%s_tool_bar'%$id diff --git a/gr-qtgui/grc/qtgui_number_sink.xml b/gr-qtgui/grc/qtgui_number_sink.xml index d10b7325c0..06837493c3 100644 --- a/gr-qtgui/grc/qtgui_number_sink.xml +++ b/gr-qtgui/grc/qtgui_number_sink.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Number Sink</name> <key>qtgui_number_sink</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>import sip</import> <make>#set $win = 'self._%s_win'%$id diff --git a/gr-qtgui/grc/qtgui_push_button.xml b/gr-qtgui/grc/qtgui_push_button.xml index a535bb6473..49c2e9d6f0 100644 --- a/gr-qtgui/grc/qtgui_push_button.xml +++ b/gr-qtgui/grc/qtgui_push_button.xml @@ -8,7 +8,7 @@ <block> <name>QT GUI Push Button</name> <key>variable_qtgui_push_button</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $win = '_%s_push_button'%$id #if not $label() diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml index 7488ea59d8..a9bc469cd2 100644 --- a/gr-qtgui/grc/qtgui_sink_x.xml +++ b/gr-qtgui/grc/qtgui_sink_x.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Sink</name> <key>qtgui_sink_x</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>from gnuradio.filter import firdes</import> <import>import sip</import> diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml index 1bbadc8e51..805542cc8b 100644 --- a/gr-qtgui/grc/qtgui_tab_widget.xml +++ b/gr-qtgui/grc/qtgui_tab_widget.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Tab Widget</name> <key>qtgui_tab_widget</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <make>#set $win = 'self.%s'%$id Qt.QTabWidget() #set $all_labels = [$label0, $label1, $label2, $label3, $label4, diff --git a/gr-qtgui/grc/qtgui_time_raster_x.xml b/gr-qtgui/grc/qtgui_time_raster_x.xml index 0359dc3b71..d458f67eb9 100644 --- a/gr-qtgui/grc/qtgui_time_raster_x.xml +++ b/gr-qtgui/grc/qtgui_time_raster_x.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Time Raster Sink</name> <key>qtgui_time_raster_sink_x</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>import sip</import> <make>#set $win = 'self._%s_win'%$id diff --git a/gr-qtgui/grc/qtgui_time_sink_x.xml b/gr-qtgui/grc/qtgui_time_sink_x.xml index c0584b6d34..f78c3e2958 100644 --- a/gr-qtgui/grc/qtgui_time_sink_x.xml +++ b/gr-qtgui/grc/qtgui_time_sink_x.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Time Sink</name> <key>qtgui_time_sink_x</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>from gnuradio.filter import firdes</import> <import>import sip</import> diff --git a/gr-qtgui/grc/qtgui_vector_sink_f.xml b/gr-qtgui/grc/qtgui_vector_sink_f.xml index 9f40d57729..0f456323bf 100644 --- a/gr-qtgui/grc/qtgui_vector_sink_f.xml +++ b/gr-qtgui/grc/qtgui_vector_sink_f.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Vector Sink</name> <key>qtgui_vector_sink_f</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>import sip</import> <make>#set $win = 'self._%s_win'%$id diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml index cdecd5cce1..a684492246 100644 --- a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml +++ b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Waterfall Sink</name> <key>qtgui_waterfall_sink_x</key> - <import>from PyQt4 import Qt</import> + <import>from PyQt5 import Qt</import> <import>from gnuradio import qtgui</import> <import>from gnuradio.filter import firdes</import> <import>import sip</import> diff --git a/gr-qtgui/include/QtWidgets/QRegExpValidator b/gr-qtgui/include/QtWidgets/QRegExpValidator new file mode 100644 index 0000000000..17f6ce8333 --- /dev/null +++ b/gr-qtgui/include/QtWidgets/QRegExpValidator @@ -0,0 +1,9 @@ +/* + * The Qt5 version of the 'uic' compiler generates incorrect code right now. + * The bug has been reported (https://bugreports.qt.io/browse/QTBUG-48492) and + * is pending review. + * + * This file will make sure that the build of gr-qtgui will succeed with the + * broken version of 'uic'. + */ +#include <QtGui/QRegExpValidator> diff --git a/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt b/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt index 991c7583a8..92ffef9ee7 100644 --- a/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt +++ b/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt @@ -68,5 +68,4 @@ install(FILES VectorDisplayPlot.h vector_sink_f.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/qtgui - COMPONENT "qtgui_devel" ) diff --git a/gr-qtgui/include/gnuradio/qtgui/form_menus.h b/gr-qtgui/include/gnuradio/qtgui/form_menus.h index cb9b775e8b..1fa7413117 100644 --- a/gr-qtgui/include/gnuradio/qtgui/form_menus.h +++ b/gr-qtgui/include/gnuradio/qtgui/form_menus.h @@ -28,6 +28,11 @@ #include <QtGui/QtGui> #include <QtGui/QIntValidator> #include <QtGui/QDoubleValidator> + +#if QT_VERSION >= 0x050000 +#include <QtWidgets/QtWidgets> +#endif + #include <qwt_symbol.h> #include <gnuradio/filter/firdes.h> #include <gnuradio/qtgui/qtgui_types.h> diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt index b1ee580398..e9740a8cf0 100644 --- a/gr-qtgui/lib/CMakeLists.txt +++ b/gr-qtgui/lib/CMakeLists.txt @@ -45,8 +45,14 @@ set(qtgui_moc_hdrs ${qtgui_mod_includedir}/VectorDisplayPlot.h edit_box_msg_impl.h ) -QT4_WRAP_CPP(qtgui_moc_sources ${qtgui_moc_hdrs}) -QT4_WRAP_UI(qtgui_ui_hdrs spectrumdisplayform.ui) + +if (${DESIRED_QT_VERSION} MATCHES 4) + QT4_WRAP_CPP(qtgui_moc_sources ${qtgui_moc_hdrs}) + QT4_WRAP_UI(qtgui_ui_hdrs spectrumdisplayform.ui) +else() + QT5_WRAP_CPP(qtgui_moc_sources ${qtgui_moc_hdrs}) + QT5_WRAP_UI(qtgui_ui_hdrs spectrumdisplayform.ui) +endif() #FIXME the sources expect <foo>.ui.h, but the macros generate ui_foo.h #avoid changing the sources by generating the header with the include @@ -177,7 +183,7 @@ endif(ENABLE_PYTHON) add_definitions(-DQWT_DLL) #setup QWT library linkage add_library(gnuradio-qtgui SHARED ${qtgui_sources}) target_link_libraries(gnuradio-qtgui ${qtgui_libs}) -GR_LIBRARY_FOO(gnuradio-qtgui RUNTIME_COMPONENT "qtgui_runtime" DEVEL_COMPONENT "qtgui_devel") +GR_LIBRARY_FOO(gnuradio-qtgui) if(ENABLE_STATIC_LIBS) if(ENABLE_GR_CTRLPORT) @@ -199,6 +205,6 @@ if(ENABLE_STATIC_LIBS) endif(NOT WIN32) install(TARGETS gnuradio-qtgui_static - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "qtgui_devel" # .lib file + ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file ) endif(ENABLE_STATIC_LIBS) diff --git a/gr-qtgui/lib/SpectrumGUIClass.cc b/gr-qtgui/lib/SpectrumGUIClass.cc index cf7c728251..fe1973fc75 100644 --- a/gr-qtgui/lib/SpectrumGUIClass.cc +++ b/gr-qtgui/lib/SpectrumGUIClass.cc @@ -26,7 +26,6 @@ #include <gnuradio/qtgui/SpectrumGUIClass.h> //Added by qt3to4: #include <QEvent> -#include <QCustomEvent> #include <volk/volk.h> const long SpectrumGUIClass::MAX_FFT_SIZE = 32768; diff --git a/gr-qtgui/lib/const_sink_c_impl.cc b/gr-qtgui/lib/const_sink_c_impl.cc index 63777d7827..26ddf793dc 100644 --- a/gr-qtgui/lib/const_sink_c_impl.cc +++ b/gr-qtgui/lib/const_sink_c_impl.cc @@ -128,7 +128,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/edit_box_msg_impl.cc b/gr-qtgui/lib/edit_box_msg_impl.cc index 084e2d4f34..0dee1fa18b 100644 --- a/gr-qtgui/lib/edit_box_msg_impl.cc +++ b/gr-qtgui/lib/edit_box_msg_impl.cc @@ -65,10 +65,6 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 - std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); - QApplication::setGraphicsSystem(QString(style.c_str())); -#endif d_qApplication = new QApplication(d_argc, &d_argv); } diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc index ffa4e3017c..c697e8c269 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.cc +++ b/gr-qtgui/lib/freq_sink_c_impl.cc @@ -154,7 +154,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc index 3fe2572eb0..046414ffaf 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.cc +++ b/gr-qtgui/lib/freq_sink_f_impl.cc @@ -153,7 +153,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc index cd48de8666..13e50b217c 100644 --- a/gr-qtgui/lib/histogram_sink_f_impl.cc +++ b/gr-qtgui/lib/histogram_sink_f_impl.cc @@ -115,7 +115,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc index ba34eaaa32..ba1be4b7c3 100644 --- a/gr-qtgui/lib/sink_c_impl.cc +++ b/gr-qtgui/lib/sink_c_impl.cc @@ -130,7 +130,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc index 17a4f78db4..73b6fcad83 100644 --- a/gr-qtgui/lib/sink_f_impl.cc +++ b/gr-qtgui/lib/sink_f_impl.cc @@ -130,7 +130,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.cc b/gr-qtgui/lib/time_raster_sink_b_impl.cc index cc13faf49a..1e2fe360b1 100644 --- a/gr-qtgui/lib/time_raster_sink_b_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc @@ -130,7 +130,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.cc b/gr-qtgui/lib/time_raster_sink_f_impl.cc index 873bd68555..e4cbb0d38f 100644 --- a/gr-qtgui/lib/time_raster_sink_f_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc @@ -128,7 +128,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc index d7514aebaa..25d5a687d1 100644 --- a/gr-qtgui/lib/time_sink_c_impl.cc +++ b/gr-qtgui/lib/time_sink_c_impl.cc @@ -129,7 +129,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc index b3b1c5909d..419a9243c4 100644 --- a/gr-qtgui/lib/time_sink_f_impl.cc +++ b/gr-qtgui/lib/time_sink_f_impl.cc @@ -126,7 +126,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/vector_sink_f_impl.cc b/gr-qtgui/lib/vector_sink_f_impl.cc index 6197da4949..fedef9654d 100644 --- a/gr-qtgui/lib/vector_sink_f_impl.cc +++ b/gr-qtgui/lib/vector_sink_f_impl.cc @@ -139,7 +139,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc b/gr-qtgui/lib/waterfall_sink_c_impl.cc index fbc655afba..4306b97d71 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc @@ -154,7 +154,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc b/gr-qtgui/lib/waterfall_sink_f_impl.cc index fdb8fde686..9789c2cf6d 100644 --- a/gr-qtgui/lib/waterfall_sink_f_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc @@ -154,7 +154,7 @@ namespace gr { d_qApplication = qApp; } else { -#if QT_VERSION >= 0x040500 +#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000 std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); QApplication::setGraphicsSystem(QString(style.c_str())); #endif diff --git a/gr-qtgui/python/qtgui/CMakeLists.txt b/gr-qtgui/python/qtgui/CMakeLists.txt index 1c20033db2..5df3a7d91b 100644 --- a/gr-qtgui/python/qtgui/CMakeLists.txt +++ b/gr-qtgui/python/qtgui/CMakeLists.txt @@ -20,12 +20,20 @@ ######################################################################## include(GrPython) +if (DESIRED_QT_VERSION MATCHES 4) + set(PY_QT_IMPORT "from PyQt4 import Qt, QtCore, QtGui as QtWidgets") +else() + set(PY_QT_IMPORT "from PyQt5 import Qt, QtCore, QtWidgets") +endif() + +configure_file(range.py.cmakein "${CMAKE_CURRENT_BINARY_DIR}/range.py" @ONLY) +configure_file(util.py.cmakein "${CMAKE_CURRENT_BINARY_DIR}/util.py" @ONLY) + GR_PYTHON_INSTALL( FILES __init__.py - range.py - util.py + "${CMAKE_CURRENT_BINARY_DIR}/range.py" + "${CMAKE_CURRENT_BINARY_DIR}/util.py" DESTINATION ${GR_PYTHON_DIR}/gnuradio/qtgui - COMPONENT "qtgui_python" ) ######################################################################## diff --git a/gr-qtgui/python/qtgui/range.py b/gr-qtgui/python/qtgui/range.py.cmakein index ca42bf71f7..00db509762 100755 --- a/gr-qtgui/python/qtgui/range.py +++ b/gr-qtgui/python/qtgui/range.py.cmakein @@ -21,7 +21,7 @@ # Boston, MA 02110-1301, USA. # -from PyQt4 import Qt, QtCore, QtGui +@PY_QT_IMPORT@ import util class Range(object): @@ -64,10 +64,10 @@ class Range(object): return (val*self.step+self.min) -class RangeWidget(QtGui.QWidget): +class RangeWidget(QtWidgets.QWidget): def __init__(self, ranges, slot, label, style, rangeType=float): """ Creates the QT Range widget """ - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.range = ranges self.style = style @@ -98,10 +98,10 @@ class RangeWidget(QtGui.QWidget): layout.addWidget(self.d_widget) self.setLayout(layout) - class Dial(QtGui.QDial): + class Dial(QtWidgets.QDial): """ Creates the range using a dial """ def __init__(self, parent, ranges, slot, rangeType=float): - QtGui.QDial.__init__(self, parent) + QtWidgets.QDial.__init__(self, parent) self.rangeType = rangeType @@ -124,10 +124,10 @@ class RangeWidget(QtGui.QWidget): val = self.range.map_range(value) self.notifyChanged(self.rangeType(val)) - class Slider(QtGui.QSlider): + class Slider(QtWidgets.QSlider): """ Creates the range using a slider """ def __init__(self, parent, ranges, slot, rangeType=float): - QtGui.QSlider.__init__(self, QtCore.Qt.Horizontal, parent) + QtWidgets.QSlider.__init__(self, QtCore.Qt.Horizontal, parent) self.rangeType = rangeType @@ -166,18 +166,18 @@ class RangeWidget(QtGui.QWidget): event.accept() # Use repaint rather than calling the super mousePressEvent. # Calling super causes issue where slider jumps to wrong value. - QtGui.QSlider.repaint(self) + QtWidgets.QSlider.repaint(self) def mouseMoveEvent(self, event): new = self.minimum() + ((self.maximum()-self.minimum()) * event.x()) / self.width() self.setValue(new) event.accept() - QtGui.QSlider.repaint(self) + QtWidgets.QSlider.repaint(self) - class Counter(QtGui.QDoubleSpinBox): + class Counter(QtWidgets.QDoubleSpinBox): """ Creates the range using a counter """ def __init__(self, parent, ranges, slot, rangeType=float): - QtGui.QDoubleSpinBox.__init__(self, parent) + QtWidgets.QDoubleSpinBox.__init__(self, parent) self.rangeType = rangeType @@ -196,10 +196,10 @@ class RangeWidget(QtGui.QWidget): """ Handle the valueChanged signal by converting to the right type """ self.notifyChanged(self.rangeType(value)) - class CounterSlider(QtGui.QWidget): + class CounterSlider(QtWidgets.QWidget): """ Creates the range using a counter and slider """ def __init__(self, parent, ranges, slot, rangeType=float): - QtGui.QWidget.__init__(self, parent) + QtWidgets.QWidget.__init__(self, parent) self.rangeType = rangeType diff --git a/gr-qtgui/python/qtgui/util.py b/gr-qtgui/python/qtgui/util.py.cmakein index d2e9495ac6..ec654d9ba2 100644 --- a/gr-qtgui/python/qtgui/util.py +++ b/gr-qtgui/python/qtgui/util.py.cmakein @@ -21,15 +21,14 @@ # Boston, MA 02110-1301, USA. # -from PyQt4 import Qt, QtCore, QtGui +@PY_QT_IMPORT@ from gnuradio import gr def check_set_qss(): - app = QtGui.qApp + app = QtWidgets.qApp qssfile = gr.prefs().get_string("qtgui","qss","") if(len(qssfile)>0): try: app.setStyleSheet(open(qssfile).read()) except: print "WARNING: bad QSS file, %s"%(qssfile) - diff --git a/gr-qtgui/swig/CMakeLists.txt b/gr-qtgui/swig/CMakeLists.txt index 44b5c2fbd4..2990ac9086 100644 --- a/gr-qtgui/swig/CMakeLists.txt +++ b/gr-qtgui/swig/CMakeLists.txt @@ -51,12 +51,10 @@ GR_SWIG_MAKE(qtgui_swig qtgui_swig.i) GR_SWIG_INSTALL( TARGETS qtgui_swig DESTINATION ${GR_PYTHON_DIR}/gnuradio/qtgui - COMPONENT "qtgui_python" ) install(FILES qtgui_swig.i ${CMAKE_CURRENT_BINARY_DIR}/qtgui_swig_doc.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig - COMPONENT "qtgui_swig" ) |