Accepting request 699642 from home:cgiboudeaux:noqt4

- Add some missing optional dependencies: libgsm and codec2.
- Add upstream patches to build gnuradio using Qt5 on openSUSE > 1500

OBS-URL: https://build.opensuse.org/request/show/699642
OBS-URL: https://build.opensuse.org/package/show/hardware:sdr/gnuradio?expand=0&rev=34
This commit is contained in:
Martin Hauke 2019-05-02 07:56:11 +00:00 committed by Git OBS Bridge
parent 2938a10e08
commit 11841f9107
23 changed files with 10742 additions and 2 deletions

View File

@ -0,0 +1,24 @@
From a7f7123b32b00408cd32b34c479b3bc23c3ec359 Mon Sep 17 00:00:00 2001
From: Christophe Giboudeaux <christophe@krop.fr>
Date: Mon, 29 Apr 2019 12:53:48 +0200
Subject: [PATCH] Add the include path used by the openSUSE package.
---
cmake/Modules/FindQwt.cmake | 1 +
1 file changed, 1 insertion(+)
diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake
index 2b83fbf..5d54a2b 100644
--- a/cmake/Modules/FindQwt.cmake
+++ b/cmake/Modules/FindQwt.cmake
@@ -19,6 +19,7 @@ find_path(QWT_INCLUDE_DIRS
PATHS
/usr/local/include/qwt-qt5
/usr/local/include/qwt
+ /usr/include/qt5/qwt6
/usr/include/qwt6
/usr/include/qwt-qt5
/usr/include/qwt
--
2.21.0

View File

@ -1,3 +1,33 @@
-------------------------------------------------------------------
Mon Apr 29 11:35:24 UTC 2019 - Christophe Giboudeaux <christophe@krop.fr>
- Add some missing optional dependencies: libgsm and codec2.
-------------------------------------------------------------------
Mon Apr 29 10:37:15 UTC 2019 - Christophe Giboudeaux <christophe@krop.fr>
- Add upstream patches to build gnuradio using Qt5 on openSUSE > 1500:
- qt5-maint-0001-CMake-Update-required-minimum-version-to-2.8.12.patch
- qt5-maint-0002-CMake-FindQwt-Find-the-Qt5-version-of-QWT-instead-of.patch
- qt5-maint-0003-gr-qtgui-update-for-Qt5.patch
- qt5-maint-0004-grc-Generate-Python-scripts-that-use-PyQt5.patch
- qt5-maint-0005-gr-qtgui-Add-a-workaround-for-an-upstream-bug-of-uic.patch
- qt5-maint-0006-qtgui-fixed-examples-for-Qt5-compatibility.patch
- qt5-maint-0007-qtgui-Fixes-for-edit_box_msg-to-work-with-QT5.patch
- qt5-maint-0008-gr-qtgui-Allow-build-with-Qt4-or-Qt5-default.patch
- qt5-maint-0009-gr-qtgui-Fix-PyQt-4-5-include-in-XMLs-for-GRC.patch
- qt5-maint-0010-gr-qtgui-Fix-range.py-to-work-with-both-Qt4-and-Qt5.patch
- qt5-maint-0011-gr-qtgui-Re-introduce-some-Qt4-specific-code.patch
- qt5-maint-0012-grc-Fix-generation-of-Python-code-for-Qt4-and-Qt5.patch
- qt5-maint-0013-grc-replace-templated-xml-files-with-search-and-repl.patch
- qt5-maint-0014-qtgui-replace-templated-xml-files-with-search-and-re.patch
- qt5-maint-0017-qtgui-fix-stylesheet-for-qt5.patch
- qt5-maint-0019-qtgui-fixed-apps-for-Qt5-compatibility.patch
- qt5-maint-0021-gnuradio-runtime-ctrlport-qt5.patch
- qt5-maint-0022-gr-uhd-qt5.patch
- qt5-maint-0023-gr-qtgui-util.patch
- qt5-maint-0024-gr-qtgui-restoreGeometry.patch
-------------------------------------------------------------------
Mon Apr 22 15:27:32 UTC 2019 - Wojciech Kazubski <wk@ire.pw.edu.pl>

View File

@ -33,7 +33,30 @@ Source3: https://github.com/gnuradio/volk/archive/v%{volk_version}.tar.gz
# http://www.nathanwest.us/grc_to_37.sh
Source4: grc_to_37.sh
Source99: %{name}-rpmlintrc
Patch2: missing_library.patch
Patch0: missing_library.patch
# PATCH 100-120 Qt5 port patches
Patch100: qt5-maint-0001-CMake-Update-required-minimum-version-to-2.8.12.patch
Patch101: qt5-maint-0002-CMake-FindQwt-Find-the-Qt5-version-of-QWT-instead-of.patch
Patch102: qt5-maint-0003-gr-qtgui-update-for-Qt5.patch
Patch103: qt5-maint-0004-grc-Generate-Python-scripts-that-use-PyQt5.patch
Patch104: qt5-maint-0005-gr-qtgui-Add-a-workaround-for-an-upstream-bug-of-uic.patch
Patch105: qt5-maint-0006-qtgui-fixed-examples-for-Qt5-compatibility.patch
Patch106: qt5-maint-0007-qtgui-Fixes-for-edit_box_msg-to-work-with-QT5.patch
Patch107: qt5-maint-0008-gr-qtgui-Allow-build-with-Qt4-or-Qt5-default.patch
Patch108: qt5-maint-0009-gr-qtgui-Fix-PyQt-4-5-include-in-XMLs-for-GRC.patch
Patch109: qt5-maint-0010-gr-qtgui-Fix-range.py-to-work-with-both-Qt4-and-Qt5.patch
Patch110: qt5-maint-0011-gr-qtgui-Re-introduce-some-Qt4-specific-code.patch
Patch111: qt5-maint-0012-grc-Fix-generation-of-Python-code-for-Qt4-and-Qt5.patch
Patch112: qt5-maint-0013-grc-replace-templated-xml-files-with-search-and-repl.patch
Patch113: qt5-maint-0014-qtgui-replace-templated-xml-files-with-search-and-re.patch
Patch114: qt5-maint-0017-qtgui-fix-stylesheet-for-qt5.patch
Patch115: qt5-maint-0019-qtgui-fixed-apps-for-Qt5-compatibility.patch
Patch116: qt5-maint-0021-gnuradio-runtime-ctrlport-qt5.patch
Patch117: qt5-maint-0022-gr-uhd-qt5.patch
Patch118: qt5-maint-0023-gr-qtgui-util.patch
Patch119: qt5-maint-0024-gr-qtgui-restoreGeometry.patch
#PATCH-FIX-OPENSUSE 0001-Add-the-include-path-used-by-the-openSUSE-package.patch
Patch120: 0001-Add-the-include-path-used-by-the-openSUSE-package.patch
BuildRequires: alsa-devel
%if 0%{?suse_version} > 1325
BuildRequires: libboost_filesystem-devel
@ -49,6 +72,7 @@ BuildRequires: fftw3-threads-devel
BuildRequires: gcc-c++
BuildRequires: gsl-devel
BuildRequires: libSDL-devel
BuildRequires: libgsm-devel
BuildRequires: libjack-devel
BuildRequires: libxslt-python
BuildRequires: memory-constraints
@ -61,13 +85,19 @@ BuildRequires: python-gtk
BuildRequires: python-lxml
BuildRequires: python-mako
BuildRequires: python-numpy
%if 0%{?suse_version} > 1500
BuildRequires: python-qt5-devel
BuildRequires: qwt6-qt5-devel
%else
BuildRequires: python-qt4-devel
BuildRequires: qwt6-devel
%endif
BuildRequires: swig
BuildRequires: texlive-dvips
BuildRequires: texlive-latex
BuildRequires: uhd-devel
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(codec2)
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(libxml-2.0)
# Workaround for openssl migration
@ -77,7 +107,12 @@ Requires: python-Cheetah
Requires: python-gtk
Requires: python-lxml
Requires: python-numpy
%if 0%{?suse_version} > 1500
Requires: python-qt5
%else
Requires: python-qt4
%endif
%if 0%{?suse_version} > 1320
BuildRequires: python-wxWidgets-3_0
%else
@ -199,7 +234,31 @@ This package contains the examples of using GNU Radio depending on wxWidgets.
%prep
%setup -q
tar xzf %{SOURCE3} -C volk/ --strip-components=1
%patch2 -p1
%patch0 -p1
%if 0%{?suse_version} > 1500
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch110 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
%patch115 -p1
%patch116 -p1
%patch117 -p1
%patch118 -p1
%patch119 -p1
%patch120 -p1
%endif
# remove buildtime from documentation
sed -i 's|^HTML_TIMESTAMP = YES|HTML_TIMESTAMP = NO|' docs/doxygen/Doxyfile.in
sed -i 's|^HTML_TIMESTAMP = YES|HTML_TIMESTAMP = NO|' docs/doxygen/Doxyfile.swig_doc.in

View File

@ -0,0 +1,28 @@
From b0f4ebcf6d656c829747dded592e182144098d42 Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 29 Sep 2015 13:57:13 +0200
Subject: [PATCH 01/22] CMake: Update required minimum version to 2.8.12
This is required to use the Qt5-specific macros.
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59e3c886c4..ae6c1e1d49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,7 +27,7 @@
########################################################################
# Make sure this version matches ${GR_CMAKE_MIN_VERSION} (a variable can't be
# used here).
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.12)
project(gnuradio CXX C)
enable_testing()
--
2.11.0

View File

@ -0,0 +1,40 @@
From 25dedc0a2a7f0790f280770a7d22e9650ae2adbf Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 29 Sep 2015 13:30:59 +0200
Subject: [PATCH 02/22] CMake: FindQwt: Find the Qt5 version of QWT instead of
the Qt4 version
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
cmake/Modules/FindQwt.cmake | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake
index da8bbe9049..2cffbe66f4 100644
--- a/cmake/Modules/FindQwt.cmake
+++ b/cmake/Modules/FindQwt.cmake
@@ -11,10 +11,10 @@ find_path(QWT_INCLUDE_DIRS
${CMAKE_INSTALL_PREFIX}/include/qwt
${CMAKE_PREFIX_PATH}/include/qwt
PATHS
- /usr/local/include/qwt-qt4
+ /usr/local/include/qwt-qt5
/usr/local/include/qwt
/usr/include/qwt6
- /usr/include/qwt-qt4
+ /usr/include/qwt-qt5
/usr/include/qwt
/usr/include/qwt5
/opt/local/include/qwt
@@ -23,7 +23,7 @@ find_path(QWT_INCLUDE_DIRS
)
find_library (QWT_LIBRARIES
- NAMES qwt6 qwt6-qt4 qwt qwt-qt4 qwt5 qwtd5
+ NAMES qwt6 qwt6-qt5 qwt qwt-qt5
HINTS
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
--
2.11.0

View File

@ -0,0 +1,575 @@
From 1f78d5f2176de31809dc34fb38945c181390cdef Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 29 Sep 2015 11:25:47 +0200
Subject: [PATCH 03/22] gr-qtgui: update for Qt5
This commit switch the gr-qtgui blocks from being usable with Qt4 to
being usable with Qt5.
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
gr-qtgui/CMakeLists.txt | 11 ++++-------
gr-qtgui/grc/qtgui_ber_sink_b.xml | 2 +-
gr-qtgui/grc/qtgui_check_box.xml | 2 +-
gr-qtgui/grc/qtgui_chooser.xml | 4 ++--
gr-qtgui/grc/qtgui_const_sink_x.xml | 2 +-
gr-qtgui/grc/qtgui_entry.xml | 2 +-
gr-qtgui/grc/qtgui_freq_sink_x.xml | 2 +-
gr-qtgui/grc/qtgui_histogram_sink_x.xml | 2 +-
gr-qtgui/grc/qtgui_label.xml | 2 +-
gr-qtgui/grc/qtgui_number_sink.xml | 2 +-
gr-qtgui/grc/qtgui_push_button.xml | 2 +-
gr-qtgui/grc/qtgui_sink_x.xml | 2 +-
gr-qtgui/grc/qtgui_tab_widget.xml | 2 +-
gr-qtgui/grc/qtgui_time_raster_x.xml | 2 +-
gr-qtgui/grc/qtgui_time_sink_x.xml | 2 +-
gr-qtgui/grc/qtgui_vector_sink_f.xml | 2 +-
gr-qtgui/grc/qtgui_waterfall_sink_x.xml | 2 +-
gr-qtgui/include/gnuradio/qtgui/form_menus.h | 1 +
gr-qtgui/lib/CMakeLists.txt | 8 ++++----
gr-qtgui/lib/SpectrumGUIClass.cc | 1 -
gr-qtgui/lib/const_sink_c_impl.cc | 4 ----
gr-qtgui/lib/freq_sink_c_impl.cc | 4 ----
gr-qtgui/lib/freq_sink_f_impl.cc | 4 ----
gr-qtgui/lib/histogram_sink_f_impl.cc | 4 ----
gr-qtgui/lib/sink_c_impl.cc | 4 ----
gr-qtgui/lib/sink_f_impl.cc | 4 ----
gr-qtgui/lib/time_raster_sink_b_impl.cc | 4 ----
gr-qtgui/lib/time_raster_sink_f_impl.cc | 4 ----
gr-qtgui/lib/time_sink_c_impl.cc | 4 ----
gr-qtgui/lib/time_sink_f_impl.cc | 4 ----
gr-qtgui/lib/vector_sink_f_impl.cc | 4 ----
gr-qtgui/lib/waterfall_sink_c_impl.cc | 4 ----
gr-qtgui/lib/waterfall_sink_f_impl.cc | 4 ----
gr-qtgui/python/qtgui/range.py | 26 +++++++++++++-------------
34 files changed, 39 insertions(+), 94 deletions(-)
--- a/gr-qtgui/CMakeLists.txt
+++ b/gr-qtgui/CMakeLists.txt
@@ -22,14 +22,14 @@
########################################################################
include(GrBoost)
-find_package(Qt4 4.2.0 COMPONENTS QtCore QtGui)
+find_package(Qt5Widgets)
find_package(Qwt)
find_package(PythonLibs 2)
include(GrPython)
-GR_PYTHON_CHECK_MODULE("PyQt4" PyQt4 True PYQT4_FOUND)
+GR_PYTHON_CHECK_MODULE("PyQt5" PyQt5 True PYQT5_FOUND)
########################################################################
# Register component
@@ -37,13 +37,13 @@
include(GrComponent)
if(NOT CMAKE_CROSSCOMPILING)
set(qt_gui_python_deps
- PYQT4_FOUND
+ PYQT5_FOUND
)
endif(NOT CMAKE_CROSSCOMPILING)
GR_REGISTER_COMPONENT("gr-qtgui" ENABLE_GR_QTGUI
Boost_FOUND
- QT4_FOUND
+ Qt5Widgets_FOUND
QWT_FOUND
ENABLE_VOLK
ENABLE_GNURADIO_RUNTIME
@@ -66,9 +66,6 @@
########################################################################
if(ENABLE_GR_QTGUI)
-# populate the environment with QT variables
-include(GrSetupQt4)
-
########################################################################
# Setup CPack components
########################################################################
--- 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 PyQt5 import Qt</import>
<import>from gnuradio import qtgui</import>
<import>import sip</import>
<import>import numpy</import>
--- 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()
--- 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())]
--- 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
--- 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
--- 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>
--- 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
--- 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
--- 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
--- 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()
--- 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>
--- 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,
--- 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
--- 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>
--- 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
--- 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>
--- a/gr-qtgui/include/gnuradio/qtgui/form_menus.h
+++ b/gr-qtgui/include/gnuradio/qtgui/form_menus.h
@@ -28,6 +28,7 @@
#include <QtGui/QtGui>
#include <QtGui/QIntValidator>
#include <QtGui/QDoubleValidator>
+#include <QtWidgets/QtWidgets>
#include <qwt_symbol.h>
#include <gnuradio/filter/firdes.h>
#include <gnuradio/qtgui/qtgui_types.h>
--- a/gr-qtgui/lib/CMakeLists.txt
+++ b/gr-qtgui/lib/CMakeLists.txt
@@ -45,8 +45,8 @@
${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)
+QT5_WRAP_CPP(qtgui_moc_sources ${qtgui_moc_hdrs})
+QT5_WRAP_UI(qtgui_ui_hdrs spectrumdisplayform.ui)
#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
@@ -127,7 +127,7 @@
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${VOLK_INCLUDE_DIRS}
${QWT_INCLUDE_DIRS}
- ${QT_INCLUDE_DIRS}
+ ${Qt5Widgets_INCLUDE_DIRS}
${FFTW3F_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
@@ -154,7 +154,7 @@
gnuradio-filter
${VOLK_LIBRARIES}
${QWT_LIBRARIES}
- ${QT_LIBRARIES}
+ ${Qt5Widgets_LIBRARIES}
${FFTW3F_LIBRARIES}
)
if (WIN32)
--- 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;
--- a/gr-qtgui/lib/const_sink_c_impl.cc
+++ b/gr-qtgui/lib/const_sink_c_impl.cc
@@ -127,10 +127,6 @@
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);
}
--- a/gr-qtgui/lib/freq_sink_c_impl.cc
+++ b/gr-qtgui/lib/freq_sink_c_impl.cc
@@ -156,10 +156,6 @@
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);
}
--- a/gr-qtgui/lib/freq_sink_f_impl.cc
+++ b/gr-qtgui/lib/freq_sink_f_impl.cc
@@ -155,10 +155,6 @@
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);
}
--- a/gr-qtgui/lib/histogram_sink_f_impl.cc
+++ b/gr-qtgui/lib/histogram_sink_f_impl.cc
@@ -115,10 +115,6 @@
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);
}
--- a/gr-qtgui/lib/sink_c_impl.cc
+++ b/gr-qtgui/lib/sink_c_impl.cc
@@ -131,10 +131,6 @@
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);
}
--- a/gr-qtgui/lib/sink_f_impl.cc
+++ b/gr-qtgui/lib/sink_f_impl.cc
@@ -131,10 +131,6 @@
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);
}
--- a/gr-qtgui/lib/time_raster_sink_b_impl.cc
+++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc
@@ -130,10 +130,6 @@
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);
}
--- a/gr-qtgui/lib/time_raster_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc
@@ -128,10 +128,6 @@
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);
}
--- a/gr-qtgui/lib/time_sink_c_impl.cc
+++ b/gr-qtgui/lib/time_sink_c_impl.cc
@@ -134,10 +134,6 @@
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);
}
--- a/gr-qtgui/lib/time_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_sink_f_impl.cc
@@ -129,10 +129,6 @@
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);
}
--- a/gr-qtgui/lib/vector_sink_f_impl.cc
+++ b/gr-qtgui/lib/vector_sink_f_impl.cc
@@ -140,10 +140,6 @@
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);
}
--- a/gr-qtgui/lib/waterfall_sink_c_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc
@@ -159,10 +159,6 @@
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);
}
--- a/gr-qtgui/lib/waterfall_sink_f_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc
@@ -155,10 +155,6 @@
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);
}
--- a/gr-qtgui/python/qtgui/range.py
+++ b/gr-qtgui/python/qtgui/range.py
@@ -21,7 +21,7 @@
# Boston, MA 02110-1301, USA.
#
-from PyQt4 import Qt, QtCore, QtGui
+from PyQt5 import Qt, QtCore, QtWidgets
import util
class Range(object):
@@ -64,10 +64,10 @@
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 @@
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 @@
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 @@
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 @@
""" 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

View File

@ -0,0 +1,53 @@
From e58eb487c4119866f8c820658c8cda173bc96370 Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 29 Sep 2015 13:22:46 +0200
Subject: [PATCH 04/22] grc: Generate Python scripts that use PyQt5
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
grc/blocks/options.xml | 2 +-
grc/core/generator/flow_graph.tmpl | 8 ++------
2 files changed, 3 insertions(+), 7 deletions(-)
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -16,7 +16,7 @@
import wx
#end if
#if $generate_options() == 'qt_gui'
-from PyQt4 import Qt
+from PyQt5 import Qt
import sys
#end if
#if $generate_options() == 'bokeh_gui'
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -118,7 +118,7 @@
self.top_layout.addLayout(self.top_grid_layout)
self.settings = Qt.QSettings("GNU Radio", "$class_name")
- self.restoreGeometry(self.settings.value("geometry").toByteArray())
+ self.restoreGeometry(self.settings.value("geometry"))
#elif $generate_options == 'bokeh_gui'
@@ -435,10 +435,6 @@
serverProc.terminate()
serverProc.kill()
#elif $generate_options == 'qt_gui'
- from distutils.version import StrictVersion
- if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
- style = gr.prefs().get_string('qtgui', 'style', 'raster')
- Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)
tb = top_block_cls($(', '.join($params_eq_list)))
@@ -457,7 +453,7 @@
def quitting():
tb.stop()
tb.wait()
- qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
+ qapp.aboutToQuit.connect(quitting)
#for $m in $monitors
if $m.has_param('en'):
if $m.get_param('en').get_value():

View File

@ -0,0 +1,33 @@
From 45c65ebeefcb20c2d2480b11b299d49f288c3b73 Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Mon, 12 Oct 2015 12:19:42 +0200
Subject: [PATCH 05/22] gr-qtgui: Add a workaround for an upstream bug of 'uic'
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.
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
gr-qtgui/include/QtWidgets/QRegExpValidator | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 gr-qtgui/include/QtWidgets/QRegExpValidator
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>
--
2.11.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
From 1dae9e033016f35416cb433a8a129b4f011eb8c1 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <tom@trondeau.com>
Date: Thu, 28 Apr 2016 10:53:12 -0400
Subject: [PATCH 07/22] qtgui: Fixes for edit_box_msg to work with QT5.
---
gr-qtgui/examples/c++/CMakeLists.txt | 20 +++++++++++---------
gr-qtgui/grc/qtgui_edit_box_msg.xml | 2 +-
gr-qtgui/lib/edit_box_msg_impl.cc | 4 ----
3 files changed, 12 insertions(+), 14 deletions(-)
--- a/gr-qtgui/examples/c++/CMakeLists.txt
+++ b/gr-qtgui/examples/c++/CMakeLists.txt
@@ -18,14 +18,14 @@
# Boston, MA 02110-1301, USA.
include_directories(
- ${GR_QTGUI_INCLUDE_DIRS}
- ${GR_ANALOG_INCLUDE_DIRS}
- ${GR_FILTER_INCLUDE_DIRS}
- ${GR_BLOCKS_INCLUDE_DIRS}
- ${GR_FFT_INCLUDE_DIRS}
- ${GNURADIO_RUNTIME_INCLUDE_DIRS}
- ${QT_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS}
+ ${GR_QTGUI_INCLUDE_DIRS}
+ ${GR_ANALOG_INCLUDE_DIRS}
+ ${GR_FILTER_INCLUDE_DIRS}
+ ${GR_BLOCKS_INCLUDE_DIRS}
+ ${GR_FFT_INCLUDE_DIRS}
+ ${GNURADIO_RUNTIME_INCLUDE_DIRS}
+ ${Qt5Widgets_INCLUDE_DIRS}
+ ${Boost_INCLUDE_DIRS}
)
list(APPEND QTGUI_LIBRARIES
@@ -35,9 +35,11 @@
gnuradio-blocks
gnuradio-fft
gnuradio-runtime
+ ${QWT_LIBRARY_DIRS}
+ ${Qt5Widgets_LIBRARIES}
)
-QT4_WRAP_CPP(qtgui_moc_sources display_qt.h)
+QT5_WRAP_CPP(qtgui_moc_sources display_qt.h)
add_executable(display_qt display_qt.cc ${qtgui_moc_sources})
target_link_libraries(display_qt ${QTGUI_LIBRARIES})
--- 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
--- a/gr-qtgui/lib/edit_box_msg_impl.cc
+++ b/gr-qtgui/lib/edit_box_msg_impl.cc
@@ -66,10 +66,6 @@
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);
}

View File

@ -0,0 +1,144 @@
From aa06972a708d3559eae667dd9484edadf722d73c Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Mon, 20 Jun 2016 18:37:43 +0200
Subject: [PATCH 08/22] gr-qtgui: Allow build with Qt4 or Qt5 (default)
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
gr-qtgui/CMakeLists.txt | 27 ++++++++++++++++++++-------
gr-qtgui/examples/c++/CMakeLists.txt | 11 ++++++++---
gr-qtgui/include/gnuradio/qtgui/form_menus.h | 4 ++++
gr-qtgui/lib/CMakeLists.txt | 14 ++++++++++----
4 files changed, 42 insertions(+), 14 deletions(-)
--- a/gr-qtgui/CMakeLists.txt
+++ b/gr-qtgui/CMakeLists.txt
@@ -22,14 +22,27 @@
########################################################################
include(GrBoost)
-find_package(Qt5Widgets)
-
-find_package(Qwt)
-
find_package(PythonLibs 2)
include(GrPython)
-GR_PYTHON_CHECK_MODULE("PyQt5" PyQt5 True PYQT5_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 @@
include(GrComponent)
if(NOT CMAKE_CROSSCOMPILING)
set(qt_gui_python_deps
- PYQT5_FOUND
+ PYQT${DESIRED_QT_VERSION}_FOUND
)
endif(NOT CMAKE_CROSSCOMPILING)
GR_REGISTER_COMPONENT("gr-qtgui" ENABLE_GR_QTGUI
Boost_FOUND
- Qt5Widgets_FOUND
+ QT_FOUND
QWT_FOUND
ENABLE_VOLK
ENABLE_GNURADIO_RUNTIME
--- a/gr-qtgui/examples/c++/CMakeLists.txt
+++ b/gr-qtgui/examples/c++/CMakeLists.txt
@@ -24,7 +24,7 @@
${GR_BLOCKS_INCLUDE_DIRS}
${GR_FFT_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
- ${Qt5Widgets_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
@@ -36,10 +36,15 @@
gnuradio-fft
gnuradio-runtime
${QWT_LIBRARY_DIRS}
- ${Qt5Widgets_LIBRARIES}
+ ${QT_LIBRARIES}
)
-QT5_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})
--- a/gr-qtgui/include/gnuradio/qtgui/form_menus.h
+++ b/gr-qtgui/include/gnuradio/qtgui/form_menus.h
@@ -28,7 +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>
--- a/gr-qtgui/lib/CMakeLists.txt
+++ b/gr-qtgui/lib/CMakeLists.txt
@@ -45,8 +45,14 @@
${qtgui_mod_includedir}/VectorDisplayPlot.h
edit_box_msg_impl.h
)
-QT5_WRAP_CPP(qtgui_moc_sources ${qtgui_moc_hdrs})
-QT5_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
@@ -127,7 +133,7 @@
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${VOLK_INCLUDE_DIRS}
${QWT_INCLUDE_DIRS}
- ${Qt5Widgets_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
${FFTW3F_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
@@ -154,7 +160,7 @@
gnuradio-filter
${VOLK_LIBRARIES}
${QWT_LIBRARIES}
- ${Qt5Widgets_LIBRARIES}
+ ${QT_LIBRARIES}
${FFTW3F_LIBRARIES}
)
if (WIN32)

View File

@ -0,0 +1,351 @@
From dc3db3b5ac29769aa4ab571a670d26e2fc7b6bf6 Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 21 Jun 2016 17:42:45 +0200
Subject: [PATCH 09/22] gr-qtgui: Fix PyQt[4,5] include in XMLs for GRC
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
gr-qtgui/grc/CMakeLists.txt | 9 ++++++++-
.../grc/{qtgui_ber_sink_b.xml => qtgui_ber_sink_b.xml.cmakein} | 2 +-
.../grc/{qtgui_block_tree.xml => qtgui_block_tree.xml.cmakein} | 0
.../grc/{qtgui_check_box.xml => qtgui_check_box.xml.cmakein} | 2 +-
gr-qtgui/grc/{qtgui_chooser.xml => qtgui_chooser.xml.cmakein} | 4 ++--
.../{qtgui_const_sink_x.xml => qtgui_const_sink_x.xml.cmakein} | 2 +-
.../{qtgui_edit_box_msg.xml => qtgui_edit_box_msg.xml.cmakein} | 2 +-
gr-qtgui/grc/{qtgui_entry.xml => qtgui_entry.xml.cmakein} | 2 +-
.../grc/{qtgui_freq_sink_x.xml => qtgui_freq_sink_x.xml.cmakein} | 2 +-
...i_histogram_sink_x.xml => qtgui_histogram_sink_x.xml.cmakein} | 2 +-
gr-qtgui/grc/{qtgui_label.xml => qtgui_label.xml.cmakein} | 2 +-
.../grc/{qtgui_number_sink.xml => qtgui_number_sink.xml.cmakein} | 2 +-
.../grc/{qtgui_push_button.xml => qtgui_push_button.xml.cmakein} | 2 +-
gr-qtgui/grc/{qtgui_range.xml => qtgui_range.xml.cmakein} | 0
gr-qtgui/grc/{qtgui_sink_x.xml => qtgui_sink_x.xml.cmakein} | 2 +-
.../grc/{qtgui_tab_widget.xml => qtgui_tab_widget.xml.cmakein} | 2 +-
.../{qtgui_time_raster_x.xml => qtgui_time_raster_x.xml.cmakein} | 2 +-
.../grc/{qtgui_time_sink_x.xml => qtgui_time_sink_x.xml.cmakein} | 2 +-
.../{qtgui_vector_sink_f.xml => qtgui_vector_sink_f.xml.cmakein} | 2 +-
...i_waterfall_sink_x.xml => qtgui_waterfall_sink_x.xml.cmakein} | 2 +-
20 files changed, 26 insertions(+), 19 deletions(-)
rename gr-qtgui/grc/{qtgui_ber_sink_b.xml => qtgui_ber_sink_b.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_block_tree.xml => qtgui_block_tree.xml.cmakein} (100%)
rename gr-qtgui/grc/{qtgui_check_box.xml => qtgui_check_box.xml.cmakein} (97%)
rename gr-qtgui/grc/{qtgui_chooser.xml => qtgui_chooser.xml.cmakein} (98%)
rename gr-qtgui/grc/{qtgui_const_sink_x.xml => qtgui_const_sink_x.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_edit_box_msg.xml => qtgui_edit_box_msg.xml.cmakein} (98%)
rename gr-qtgui/grc/{qtgui_entry.xml => qtgui_entry.xml.cmakein} (97%)
rename gr-qtgui/grc/{qtgui_freq_sink_x.xml => qtgui_freq_sink_x.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_histogram_sink_x.xml => qtgui_histogram_sink_x.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_label.xml => qtgui_label.xml.cmakein} (97%)
rename gr-qtgui/grc/{qtgui_number_sink.xml => qtgui_number_sink.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_push_button.xml => qtgui_push_button.xml.cmakein} (97%)
rename gr-qtgui/grc/{qtgui_range.xml => qtgui_range.xml.cmakein} (100%)
rename gr-qtgui/grc/{qtgui_sink_x.xml => qtgui_sink_x.xml.cmakein} (98%)
rename gr-qtgui/grc/{qtgui_tab_widget.xml => qtgui_tab_widget.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_time_raster_x.xml => qtgui_time_raster_x.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_time_sink_x.xml => qtgui_time_sink_x.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_vector_sink_f.xml => qtgui_vector_sink_f.xml.cmakein} (99%)
rename gr-qtgui/grc/{qtgui_waterfall_sink_x.xml => qtgui_waterfall_sink_x.xml.cmakein} (99%)
diff --git a/gr-qtgui/grc/CMakeLists.txt b/gr-qtgui/grc/CMakeLists.txt
index d56158ac70..d01bcc52c4 100644
--- a/gr-qtgui/grc/CMakeLists.txt
+++ b/gr-qtgui/grc/CMakeLists.txt
@@ -18,5 +18,12 @@
# Boston, MA 02110-1301, USA.
########################################################################
-file(GLOB xml_files "*.xml")
+file(GLOB xml_cmakein_files "*.xml.cmakein")
+
+foreach(xml_cmakein_file IN ITEMS ${xml_cmakein_files})
+ get_filename_component(FILE_NAME ${xml_cmakein_file} NAME_WE)
+ configure_file(${xml_cmakein_file} "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.xml" @ONLY)
+ set(xml_files ${xml_files} "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.xml")
+endforeach(xml_cmakein_file)
+
install(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "qtgui_python")
diff --git a/gr-qtgui/grc/qtgui_ber_sink_b.xml b/gr-qtgui/grc/qtgui_ber_sink_b.xml.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_ber_sink_b.xml
rename to gr-qtgui/grc/qtgui_ber_sink_b.xml.cmakein
index 085bf282be..91a87ce595 100644
--- a/gr-qtgui/grc/qtgui_ber_sink_b.xml
+++ b/gr-qtgui/grc/qtgui_ber_sink_b.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Bercurve Sink</name>
<key>qtgui_bercurve_sink</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ import Qt</import>
<import>from gnuradio import qtgui</import>
<import>import sip</import>
<import>import numpy</import>
diff --git a/gr-qtgui/grc/qtgui_block_tree.xml b/gr-qtgui/grc/qtgui_block_tree.xml.cmakein
similarity index 100%
rename from gr-qtgui/grc/qtgui_block_tree.xml
rename to gr-qtgui/grc/qtgui_block_tree.xml.cmakein
diff --git a/gr-qtgui/grc/qtgui_check_box.xml b/gr-qtgui/grc/qtgui_check_box.xml.cmakein
similarity index 97%
rename from gr-qtgui/grc/qtgui_check_box.xml
rename to gr-qtgui/grc/qtgui_check_box.xml.cmakein
index ccee59dd92..9edacb24d8 100644
--- a/gr-qtgui/grc/qtgui_check_box.xml
+++ b/gr-qtgui/grc/qtgui_check_box.xml.cmakein
@@ -8,7 +8,7 @@
<block>
<name>QT GUI Check Box</name>
<key>variable_qtgui_check_box</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 98%
rename from gr-qtgui/grc/qtgui_chooser.xml
rename to gr-qtgui/grc/qtgui_chooser.xml.cmakein
index f79bb8ccb3..40c782bede 100644
--- a/gr-qtgui/grc/qtgui_chooser.xml
+++ b/gr-qtgui/grc/qtgui_chooser.xml.cmakein
@@ -8,8 +8,8 @@
<block>
<name>QT GUI Chooser</name>
<key>variable_qtgui_chooser</key>
- <import>from PyQt5 import Qt</import>
- <import>from PyQt5.QtCore import QObject, pyqtSlot</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@.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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_const_sink_x.xml
rename to gr-qtgui/grc/qtgui_const_sink_x.xml.cmakein
index 10f82cce82..6fa725acb1 100644
--- a/gr-qtgui/grc/qtgui_const_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_const_sink_x.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Constellation Sink</name>
<key>qtgui_const_sink_x</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 98%
rename from gr-qtgui/grc/qtgui_edit_box_msg.xml
rename to gr-qtgui/grc/qtgui_edit_box_msg.xml.cmakein
index d77a4b3e1b..75ff93349f 100644
--- a/gr-qtgui/grc/qtgui_edit_box_msg.xml
+++ b/gr-qtgui/grc/qtgui_edit_box_msg.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Message Edit Box</name>
<key>qtgui_edit_box_msg</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 97%
rename from gr-qtgui/grc/qtgui_entry.xml
rename to gr-qtgui/grc/qtgui_entry.xml.cmakein
index fc0f4089d1..da61ee723a 100644
--- a/gr-qtgui/grc/qtgui_entry.xml
+++ b/gr-qtgui/grc/qtgui_entry.xml.cmakein
@@ -8,7 +8,7 @@
<block>
<name>QT GUI Entry</name>
<key>variable_qtgui_entry</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_freq_sink_x.xml
rename to gr-qtgui/grc/qtgui_freq_sink_x.xml.cmakein
index ed39db7781..aaf0d75271 100644
--- a/gr-qtgui/grc/qtgui_freq_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_freq_sink_x.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Frequency Sink</name>
<key>qtgui_freq_sink_x</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_histogram_sink_x.xml
rename to gr-qtgui/grc/qtgui_histogram_sink_x.xml.cmakein
index 9e3dcb104f..d04a44da13 100644
--- a/gr-qtgui/grc/qtgui_histogram_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_histogram_sink_x.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Histogram Sink</name>
<key>qtgui_histogram_sink_x</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 97%
rename from gr-qtgui/grc/qtgui_label.xml
rename to gr-qtgui/grc/qtgui_label.xml.cmakein
index 946cee36ab..c546e09dcc 100644
--- a/gr-qtgui/grc/qtgui_label.xml
+++ b/gr-qtgui/grc/qtgui_label.xml.cmakein
@@ -9,7 +9,7 @@
<block>
<name>QT GUI Label</name>
<key>variable_qtgui_label</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_number_sink.xml
rename to gr-qtgui/grc/qtgui_number_sink.xml.cmakein
index 06837493c3..d4b4c5808f 100644
--- a/gr-qtgui/grc/qtgui_number_sink.xml
+++ b/gr-qtgui/grc/qtgui_number_sink.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Number Sink</name>
<key>qtgui_number_sink</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 97%
rename from gr-qtgui/grc/qtgui_push_button.xml
rename to gr-qtgui/grc/qtgui_push_button.xml.cmakein
index 49c2e9d6f0..d99f230acf 100644
--- a/gr-qtgui/grc/qtgui_push_button.xml
+++ b/gr-qtgui/grc/qtgui_push_button.xml.cmakein
@@ -8,7 +8,7 @@
<block>
<name>QT GUI Push Button</name>
<key>variable_qtgui_push_button</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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_range.xml b/gr-qtgui/grc/qtgui_range.xml.cmakein
similarity index 100%
rename from gr-qtgui/grc/qtgui_range.xml
rename to gr-qtgui/grc/qtgui_range.xml.cmakein
diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml.cmakein
similarity index 98%
rename from gr-qtgui/grc/qtgui_sink_x.xml
rename to gr-qtgui/grc/qtgui_sink_x.xml.cmakein
index a9bc469cd2..1c75921a75 100644
--- a/gr-qtgui/grc/qtgui_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_sink_x.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Sink</name>
<key>qtgui_sink_x</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_tab_widget.xml
rename to gr-qtgui/grc/qtgui_tab_widget.xml.cmakein
index 805542cc8b..f5a1a73cdc 100644
--- a/gr-qtgui/grc/qtgui_tab_widget.xml
+++ b/gr-qtgui/grc/qtgui_tab_widget.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Tab Widget</name>
<key>qtgui_tab_widget</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_time_raster_x.xml
rename to gr-qtgui/grc/qtgui_time_raster_x.xml.cmakein
index d458f67eb9..94b7ef136a 100644
--- a/gr-qtgui/grc/qtgui_time_raster_x.xml
+++ b/gr-qtgui/grc/qtgui_time_raster_x.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Time Raster Sink</name>
<key>qtgui_time_raster_sink_x</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_time_sink_x.xml
rename to gr-qtgui/grc/qtgui_time_sink_x.xml.cmakein
index d4347950ea..d239917907 100644
--- a/gr-qtgui/grc/qtgui_time_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_time_sink_x.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Time Sink</name>
<key>qtgui_time_sink_x</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_vector_sink_f.xml
rename to gr-qtgui/grc/qtgui_vector_sink_f.xml.cmakein
index 0f456323bf..8b928eb7ea 100644
--- a/gr-qtgui/grc/qtgui_vector_sink_f.xml
+++ b/gr-qtgui/grc/qtgui_vector_sink_f.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Vector Sink</name>
<key>qtgui_vector_sink_f</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein
similarity index 99%
rename from gr-qtgui/grc/qtgui_waterfall_sink_x.xml
rename to gr-qtgui/grc/qtgui_waterfall_sink_x.xml.cmakein
index a684492246..d198ca084a 100644
--- a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml.cmakein
@@ -7,7 +7,7 @@
<block>
<name>QT GUI Waterfall Sink</name>
<key>qtgui_waterfall_sink_x</key>
- <import>from PyQt5 import Qt</import>
+ <import>from PyQt@DESIRED_QT_VERSION@ import Qt</import>
<import>from gnuradio import qtgui</import>
<import>from gnuradio.filter import firdes</import>
<import>import sip</import>
--
2.11.0

View File

@ -0,0 +1,54 @@
From 7df8c4ea6559ba211222e7d7cfb152f71dbc815b Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 21 Jun 2016 18:16:06 +0200
Subject: [PATCH 10/22] gr-qtgui: Fix range.py to work with both Qt4 and Qt5
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
gr-qtgui/python/qtgui/CMakeLists.txt | 10 +++++++++-
gr-qtgui/python/qtgui/{range.py => range.py.cmakein} | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
rename gr-qtgui/python/qtgui/{range.py => range.py.cmakein} (99%)
diff --git a/gr-qtgui/python/qtgui/CMakeLists.txt b/gr-qtgui/python/qtgui/CMakeLists.txt
index 1c20033db2..7e2d0321c4 100644
--- a/gr-qtgui/python/qtgui/CMakeLists.txt
+++ b/gr-qtgui/python/qtgui/CMakeLists.txt
@@ -20,9 +20,17 @@
########################################################################
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)
+
GR_PYTHON_INSTALL(
FILES __init__.py
- range.py
+ "${CMAKE_CURRENT_BINARY_DIR}/range.py"
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
similarity index 99%
rename from gr-qtgui/python/qtgui/range.py
rename to gr-qtgui/python/qtgui/range.py.cmakein
index f972844114..9ed7706195 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 PyQt5 import Qt, QtCore, QtWidgets
+@PY_QT_IMPORT@
import util
class Range(object):
--
2.11.0

View File

@ -0,0 +1,191 @@
From 988c1520d5b6f763caa0164faef404185e7dbc85 Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 21 Jun 2016 18:30:21 +0200
Subject: [PATCH 11/22] gr-qtgui: Re-introduce some Qt4-specific code
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
gr-qtgui/lib/const_sink_c_impl.cc | 4 ++++
gr-qtgui/lib/freq_sink_c_impl.cc | 4 ++++
gr-qtgui/lib/freq_sink_f_impl.cc | 4 ++++
gr-qtgui/lib/histogram_sink_f_impl.cc | 4 ++++
gr-qtgui/lib/sink_c_impl.cc | 4 ++++
gr-qtgui/lib/sink_f_impl.cc | 4 ++++
gr-qtgui/lib/time_raster_sink_b_impl.cc | 4 ++++
gr-qtgui/lib/time_raster_sink_f_impl.cc | 4 ++++
gr-qtgui/lib/time_sink_c_impl.cc | 4 ++++
gr-qtgui/lib/time_sink_f_impl.cc | 4 ++++
gr-qtgui/lib/vector_sink_f_impl.cc | 4 ++++
gr-qtgui/lib/waterfall_sink_c_impl.cc | 4 ++++
gr-qtgui/lib/waterfall_sink_f_impl.cc | 4 ++++
13 files changed, 52 insertions(+)
--- a/gr-qtgui/lib/const_sink_c_impl.cc
+++ b/gr-qtgui/lib/const_sink_c_impl.cc
@@ -127,6 +127,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/freq_sink_c_impl.cc
+++ b/gr-qtgui/lib/freq_sink_c_impl.cc
@@ -156,6 +156,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/freq_sink_f_impl.cc
+++ b/gr-qtgui/lib/freq_sink_f_impl.cc
@@ -155,6 +155,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/histogram_sink_f_impl.cc
+++ b/gr-qtgui/lib/histogram_sink_f_impl.cc
@@ -115,6 +115,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/sink_c_impl.cc
+++ b/gr-qtgui/lib/sink_c_impl.cc
@@ -131,6 +131,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/sink_f_impl.cc
+++ b/gr-qtgui/lib/sink_f_impl.cc
@@ -131,6 +131,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/time_raster_sink_b_impl.cc
+++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc
@@ -130,6 +130,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/time_raster_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc
@@ -128,6 +128,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/time_sink_c_impl.cc
+++ b/gr-qtgui/lib/time_sink_c_impl.cc
@@ -134,6 +134,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/time_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_sink_f_impl.cc
@@ -129,6 +129,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/vector_sink_f_impl.cc
+++ b/gr-qtgui/lib/vector_sink_f_impl.cc
@@ -140,6 +140,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/waterfall_sink_c_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc
@@ -159,6 +159,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}
--- a/gr-qtgui/lib/waterfall_sink_f_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc
@@ -155,6 +155,10 @@
d_qApplication = qApp;
}
else {
+#if QT_VERSION >= 0x040500 && QT_VERSION < 0x050000
+ 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);
}

View File

@ -0,0 +1,659 @@
From 6cd8e365b7e519f49c81cfeb7137200d7b5e8b2f Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 21 Jun 2016 19:27:19 +0200
Subject: [PATCH 12/22] grc: Fix generation of Python code for Qt4 and Qt5
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
CMakeLists.txt | 2 +-
grc/blocks/CMakeLists.txt | 4 +++-
grc/blocks/{options.xml => options.xml.cmakein} | 2 +-
grc/core/generator/flow_graph.tmpl | 13 ++++++++++++-
4 files changed, 17 insertions(+), 4 deletions(-)
rename grc/blocks/{options.xml => options.xml.cmakein} (99%)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -528,7 +528,6 @@
add_subdirectory(docs)
add_subdirectory(gnuradio-runtime)
add_subdirectory(gr-blocks)
-add_subdirectory(grc)
add_subdirectory(gr-fec)
add_subdirectory(gr-fft)
add_subdirectory(gr-filter)
@@ -551,6 +550,7 @@
add_subdirectory(gr-wavelet)
add_subdirectory(gr-wxgui)
add_subdirectory(gr-zeromq)
+add_subdirectory(grc)
# Defining GR_CTRLPORT for gnuradio/config.h
if(ENABLE_GR_CTRLPORT)
--- a/grc/blocks/CMakeLists.txt
+++ b/grc/blocks/CMakeLists.txt
@@ -22,6 +22,8 @@
file(GLOB xml_files "*.xml")
+configure_file(options.xml.cmakein "${CMAKE_CURRENT_BINARY_DIR}/options.xml" @ONLY)
+
macro(GEN_BLOCK_XML _generator _xml_block)
set(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator})
set(xml_block ${CMAKE_CURRENT_BINARY_DIR}/${_xml_block})
@@ -37,7 +39,7 @@
add_custom_target(grc_generated_xml ALL DEPENDS ${generated_xml_files})
install(
- FILES ${xml_files} ${generated_xml_files}
+ FILES ${xml_files} "${CMAKE_CURRENT_BINARY_DIR}/options.xml" ${generated_xml_files}
DESTINATION ${GRC_BLOCKS_DIR}
COMPONENT "grc"
)
--- a/grc/blocks/options.xml
+++ /dev/null
@@ -1,294 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Options Block:
-## options for window size,
-## and flow graph building.
-###################################################
- -->
-<block>
- <name>Options</name>
- <key>options</key>
- <import>from gnuradio import gr</import>
- <import>from gnuradio.filter import firdes</import>
- <import>#if $generate_options() == 'wx_gui'
-from grc_gnuradio import wxgui as grc_wxgui
-import wx
-#end if
-#if $generate_options() == 'qt_gui'
-from PyQt5 import Qt
-import sys
-#end if
-#if $generate_options() == 'bokeh_gui'
-import time
-import signal
-import functools
-from bokeh.client import push_session
-from bokeh.plotting import curdoc
-#end if
-#if not $generate_options().startswith('hb')
-from optparse import OptionParser
-from gnuradio.eng_option import eng_option
-from gnuradio import eng_notation
-#end if</import>
- <make></make>
- <callback>if $run: self.start()
-else: self.stop(); self.wait()</callback>
- <param>
- <name>Title</name>
- <key>title</key>
- <value></value>
- <type>string</type>
- <hide>#if $title() then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Author</name>
- <key>author</key>
- <value></value>
- <type>string</type>
- <hide>#if $author() then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Description</name>
- <key>description</key>
- <value></value>
- <type>string</type>
- <hide>#if $description() then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Canvas Size</name>
- <key>window_size</key>
- <value></value>
- <type>int_vector</type>
- <hide>part</hide>
- </param>
- <param>
- <name>Generate Options</name>
- <key>generate_options</key>
- <value>qt_gui</value>
- <type>enum</type>
- <option>
- <name>Bokeh GUI</name>
- <key>bokeh_gui</key>
- </option>
- <option>
- <name>QT GUI</name>
- <key>qt_gui</key>
- </option>
- <option>
- <name>WX GUI</name>
- <key>wx_gui</key>
- </option>
- <option>
- <name>No GUI</name>
- <key>no_gui</key>
- </option>
- <option>
- <name>Hier Block</name>
- <key>hb</key>
- </option>
- <option>
- <name>Hier Block (QT GUI)</name>
- <key>hb_qt_gui</key>
- </option>
- </param>
- <param>
- <name>Category</name>
- <key>category</key>
- <value>[GRC Hier Blocks]</value>
- <type>string</type>
- <hide>#if $generate_options().startswith('hb') then 'none' else 'all'#</hide>
- </param>
- <param>
- <name>Run Options</name>
- <key>run_options</key>
- <value>prompt</value>
- <type>enum</type>
- <hide>#if $generate_options() == 'no_gui' then 'none' else 'all'#</hide>
- <option>
- <name>Run to Completion</name>
- <key>run</key>
- </option>
- <option>
- <name>Prompt for Exit</name>
- <key>prompt</key>
- </option>
- </param>
- <param>
- <name>Widget Placement</name>
- <key>placement</key>
- <value>(0,0)</value>
- <type>int_vector</type>
- <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
- </param>
- <param>
- <name>Sizing Mode</name>
- <key>sizing_mode</key>
- <value>fixed</value>
- <type>enum</type>
- <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
- <option>
- <name>Fixed</name>
- <key>fixed</key>
- </option>
- <option>
- <name>Stretch Both</name>
- <key>stretch_both</key>
- </option>
- <option>
- <name>Scale Width</name>
- <key>scale_width</key>
- </option>
- <option>
- <name>Scale Height</name>
- <key>scale_height</key>
- </option>
- <option>
- <name>Scale Both</name>
- <key>scale_both</key>
- </option>
- </param>
- <param>
- <name>Run</name>
- <key>run</key>
- <value>True</value>
- <type>bool</type>
- <hide>
-#if $generate_options() in ('qt_gui', 'wx_gui', 'bokeh_gui')
- #if $run()
- part
- #else
- none
- #end if
-#else
- all
-#end if
- </hide>
- <option>
- <name>Autostart</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Max Number of Output</name>
- <key>max_nouts</key>
- <value>0</value>
- <type>int</type>
- <hide>#if $generate_options().startswith('hb')
-all#slurp
-#elif $max_nouts()
-none#slurp
-#else
-part#slurp
-#end if</hide>
- </param>
- <param>
- <name>Realtime Scheduling</name>
- <key>realtime_scheduling</key>
- <value></value>
- <type>enum</type>
- <hide>#if $generate_options().startswith('hb')
-all#slurp
-#elif $realtime_scheduling()
-none#slurp
-#else
-part#slurp
-#end if</hide>
- <option>
- <name>Off</name>
- <key></key>
- </option>
- <option>
- <name>On</name>
- <key>1</key>
- </option>
- </param>
- <param>
- <name>QSS Theme</name>
- <key>qt_qss_theme</key>
- <value></value>
- <type>file_open</type>
- <hide>
-#if $generate_options() in ('qt_gui',)
- #if $qt_qss_theme()
- none
- #else
- part
- #end if
-#else
- all
-#end if
-</hide>
- </param>
- <param>
- <name>Thread-safe setters</name>
- <key>thread_safe_setters</key>
- <value></value>
- <type>enum</type>
- <hide>part</hide>
- <option>
- <name>Off</name>
- <key></key>
- </option>
- <option>
- <name>On</name>
- <key>1</key>
- </option>
- <tab>Advanced</tab>
- </param>
- <param>
- <name>Run Command</name>
- <key>run_command</key>
- <value>{python} -u {filename}</value>
- <type>string</type>
- <hide>#if $generate_options().startswith('hb')
-all#slurp
-#else
-part#slurp
-#end if</hide>
- <tab>Advanced</tab>
- </param>
- <param>
- <name>Hier Block Source Path</name>
- <key>hier_block_src_path</key>
- <value>.:</value>
- <type>string</type>
- <hide>part</hide>
- <tab>Advanced</tab>
- </param>
- <check>not $window_size or len($window_size) == 2</check>
- <check>not $window_size or 300 &lt;= $(window_size)[0] &lt;= 4096</check>
- <check>not $window_size or 300 &lt;= $(window_size)[1] &lt;= 4096</check>
- <check>len($placement) == 4 or len($placement) == 2</check>
- <check>all(i &gt;= 0 for i in $(placement))</check>
- <doc>
-The options block sets special parameters for the flow graph. \
-Only one option block is allowed per flow graph.
-
-Title, author, and description parameters are for identification purposes.
-
-The window size controls the dimensions of the flow graph editor. \
-The window size (width, height) must be between (300, 300) and (4096, 4096).
-
-The generate options controls the type of code generated. \
-Non-graphical flow graphs should avoid using graphical sinks or graphical variable controls.
-
-In a graphical application, \
-run can be controlled by a variable to start and stop the flowgraph at runtime.
-
-The id of this block determines the name of the generated file and the name of the class. \
-For example, an id of my_block will generate the file my_block.py and class my_block(gr....
-
-The category parameter determines the placement of the block in the block selection window. \
-The category only applies when creating hier blocks. \
-To put hier blocks into the root category, enter / for the category.
-
-The Max Number of Output is the maximum number of output items allowed for any block \
-in the flowgraph; to disable this set the max_nouts equal to 0.\
-Use this to adjust the maximum latency a flowgraph can exhibit.
- </doc>
-</block>
--- /dev/null
+++ b/grc/blocks/options.xml.cmakein
@@ -0,0 +1,294 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Options Block:
+## options for window size,
+## and flow graph building.
+###################################################
+ -->
+<block>
+ <name>Options</name>
+ <key>options</key>
+ <import>from gnuradio import gr</import>
+ <import>from gnuradio.filter import firdes</import>
+ <import>#if $generate_options() == 'wx_gui'
+from grc_gnuradio import wxgui as grc_wxgui
+import wx
+#end if
+#if $generate_options() == 'qt_gui'
+from PyQt@DESIRED_QT_VERSION@ import Qt
+import sys
+#end if
+#if $generate_options() == 'bokeh_gui'
+import time
+import signal
+import functools
+from bokeh.client import push_session
+from bokeh.plotting import curdoc
+#end if
+#if not $generate_options().startswith('hb')
+from optparse import OptionParser
+from gnuradio.eng_option import eng_option
+from gnuradio import eng_notation
+#end if</import>
+ <make></make>
+ <callback>if $run: self.start()
+else: self.stop(); self.wait()</callback>
+ <param>
+ <name>Title</name>
+ <key>title</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $title() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Author</name>
+ <key>author</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $author() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Description</name>
+ <key>description</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $description() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Canvas Size</name>
+ <key>window_size</key>
+ <value></value>
+ <type>int_vector</type>
+ <hide>part</hide>
+ </param>
+ <param>
+ <name>Generate Options</name>
+ <key>generate_options</key>
+ <value>qt_gui</value>
+ <type>enum</type>
+ <option>
+ <name>Bokeh GUI</name>
+ <key>bokeh_gui</key>
+ </option>
+ <option>
+ <name>QT GUI</name>
+ <key>qt_gui</key>
+ </option>
+ <option>
+ <name>WX GUI</name>
+ <key>wx_gui</key>
+ </option>
+ <option>
+ <name>No GUI</name>
+ <key>no_gui</key>
+ </option>
+ <option>
+ <name>Hier Block</name>
+ <key>hb</key>
+ </option>
+ <option>
+ <name>Hier Block (QT GUI)</name>
+ <key>hb_qt_gui</key>
+ </option>
+ </param>
+ <param>
+ <name>Category</name>
+ <key>category</key>
+ <value>[GRC Hier Blocks]</value>
+ <type>string</type>
+ <hide>#if $generate_options().startswith('hb') then 'none' else 'all'#</hide>
+ </param>
+ <param>
+ <name>Run Options</name>
+ <key>run_options</key>
+ <value>prompt</value>
+ <type>enum</type>
+ <hide>#if $generate_options() == 'no_gui' then 'none' else 'all'#</hide>
+ <option>
+ <name>Run to Completion</name>
+ <key>run</key>
+ </option>
+ <option>
+ <name>Prompt for Exit</name>
+ <key>prompt</key>
+ </option>
+ </param>
+ <param>
+ <name>Widget Placement</name>
+ <key>placement</key>
+ <value>(0,0)</value>
+ <type>int_vector</type>
+ <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
+ </param>
+ <param>
+ <name>Sizing Mode</name>
+ <key>sizing_mode</key>
+ <value>fixed</value>
+ <type>enum</type>
+ <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
+ <option>
+ <name>Fixed</name>
+ <key>fixed</key>
+ </option>
+ <option>
+ <name>Stretch Both</name>
+ <key>stretch_both</key>
+ </option>
+ <option>
+ <name>Scale Width</name>
+ <key>scale_width</key>
+ </option>
+ <option>
+ <name>Scale Height</name>
+ <key>scale_height</key>
+ </option>
+ <option>
+ <name>Scale Both</name>
+ <key>scale_both</key>
+ </option>
+ </param>
+ <param>
+ <name>Run</name>
+ <key>run</key>
+ <value>True</value>
+ <type>bool</type>
+ <hide>
+#if $generate_options() in ('qt_gui', 'wx_gui', 'bokeh_gui')
+ #if $run()
+ part
+ #else
+ none
+ #end if
+#else
+ all
+#end if
+ </hide>
+ <option>
+ <name>Autostart</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Max Number of Output</name>
+ <key>max_nouts</key>
+ <value>0</value>
+ <type>int</type>
+ <hide>#if $generate_options().startswith('hb')
+all#slurp
+#elif $max_nouts()
+none#slurp
+#else
+part#slurp
+#end if</hide>
+ </param>
+ <param>
+ <name>Realtime Scheduling</name>
+ <key>realtime_scheduling</key>
+ <value></value>
+ <type>enum</type>
+ <hide>#if $generate_options().startswith('hb')
+all#slurp
+#elif $realtime_scheduling()
+none#slurp
+#else
+part#slurp
+#end if</hide>
+ <option>
+ <name>Off</name>
+ <key></key>
+ </option>
+ <option>
+ <name>On</name>
+ <key>1</key>
+ </option>
+ </param>
+ <param>
+ <name>QSS Theme</name>
+ <key>qt_qss_theme</key>
+ <value></value>
+ <type>file_open</type>
+ <hide>
+#if $generate_options() in ('qt_gui',)
+ #if $qt_qss_theme()
+ none
+ #else
+ part
+ #end if
+#else
+ all
+#end if
+</hide>
+ </param>
+ <param>
+ <name>Thread-safe setters</name>
+ <key>thread_safe_setters</key>
+ <value></value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Off</name>
+ <key></key>
+ </option>
+ <option>
+ <name>On</name>
+ <key>1</key>
+ </option>
+ <tab>Advanced</tab>
+ </param>
+ <param>
+ <name>Run Command</name>
+ <key>run_command</key>
+ <value>{python} -u {filename}</value>
+ <type>string</type>
+ <hide>#if $generate_options().startswith('hb')
+all#slurp
+#else
+part#slurp
+#end if</hide>
+ <tab>Advanced</tab>
+ </param>
+ <param>
+ <name>Hier Block Source Path</name>
+ <key>hier_block_src_path</key>
+ <value>.:</value>
+ <type>string</type>
+ <hide>part</hide>
+ <tab>Advanced</tab>
+ </param>
+ <check>not $window_size or len($window_size) == 2</check>
+ <check>not $window_size or 300 &lt;= $(window_size)[0] &lt;= 4096</check>
+ <check>not $window_size or 300 &lt;= $(window_size)[1] &lt;= 4096</check>
+ <check>len($placement) == 4 or len($placement) == 2</check>
+ <check>all(i &gt;= 0 for i in $(placement))</check>
+ <doc>
+The options block sets special parameters for the flow graph. \
+Only one option block is allowed per flow graph.
+
+Title, author, and description parameters are for identification purposes.
+
+The window size controls the dimensions of the flow graph editor. \
+The window size (width, height) must be between (300, 300) and (4096, 4096).
+
+The generate options controls the type of code generated. \
+Non-graphical flow graphs should avoid using graphical sinks or graphical variable controls.
+
+In a graphical application, \
+run can be controlled by a variable to start and stop the flowgraph at runtime.
+
+The id of this block determines the name of the generated file and the name of the class. \
+For example, an id of my_block will generate the file my_block.py and class my_block(gr....
+
+The category parameter determines the placement of the block in the block selection window. \
+The category only applies when creating hier blocks. \
+To put hier blocks into the root category, enter / for the category.
+
+The Max Number of Output is the maximum number of output items allowed for any block \
+in the flowgraph; to disable this set the max_nouts equal to 0.\
+Use this to adjust the maximum latency a flowgraph can exhibit.
+ </doc>
+</block>
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -36,6 +36,10 @@
import threading
#end if
+#if $generate_options == 'qt_gui'
+from distutils.version import StrictVersion
+#end if
+
## Call XInitThreads as the _very_ first thing.
## After some Qt import, it's too late
#if $generate_options in ('wx_gui', 'qt_gui', 'bokeh_gui')

View File

@ -0,0 +1,650 @@
From ab58fcfd12be3e60a9dfaac757a3b8c663c2fc4b Mon Sep 17 00:00:00 2001
From: Sebastian Koslowski <koslowski@kit.edu>
Date: Tue, 30 Aug 2016 09:49:58 +0200
Subject: [PATCH 13/22] grc: replace templated xml files with search and
replace for qt4
---
grc/blocks/CMakeLists.txt | 23 +++++++++++++++++++----
grc/blocks/{options.xml.cmakein => options.xml} | 2 +-
2 files changed, 20 insertions(+), 5 deletions(-)
rename grc/blocks/{options.xml.cmakein => options.xml} (99%)
--- a/grc/blocks/CMakeLists.txt
+++ b/grc/blocks/CMakeLists.txt
@@ -22,7 +22,18 @@
file(GLOB xml_files "*.xml")
-configure_file(options.xml.cmakein "${CMAKE_CURRENT_BINARY_DIR}/options.xml" @ONLY)
+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()
macro(GEN_BLOCK_XML _generator _xml_block)
set(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator})
@@ -32,14 +43,18 @@
DEPENDS ${generator} OUTPUT ${xml_block}
COMMAND ${PYTHON_EXECUTABLE} ${generator} ${xml_block}
)
-endmacro(GEN_BLOCK_XML)
+endmacro()
+
+GEN_BLOCK_XML(variable_struct.xml.py variable_struct.xml)
-GEN_BLOCK_XML(variable_struct.xml.py variable_struct.xml)
+if(DESIRED_QT_VERSION EQUAL 4)
+ REPLACE_IN_FILE(options.xml PyQt5 PyQt4)
+endif()
add_custom_target(grc_generated_xml ALL DEPENDS ${generated_xml_files})
install(
- FILES ${xml_files} "${CMAKE_CURRENT_BINARY_DIR}/options.xml" ${generated_xml_files}
+ FILES ${xml_files} ${generated_xml_files}
DESTINATION ${GRC_BLOCKS_DIR}
COMPONENT "grc"
)
--- a/grc/blocks/options.xml.cmakein
+++ /dev/null
@@ -1,294 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Options Block:
-## options for window size,
-## and flow graph building.
-###################################################
- -->
-<block>
- <name>Options</name>
- <key>options</key>
- <import>from gnuradio import gr</import>
- <import>from gnuradio.filter import firdes</import>
- <import>#if $generate_options() == 'wx_gui'
-from grc_gnuradio import wxgui as grc_wxgui
-import wx
-#end if
-#if $generate_options() == 'qt_gui'
-from PyQt@DESIRED_QT_VERSION@ import Qt
-import sys
-#end if
-#if $generate_options() == 'bokeh_gui'
-import time
-import signal
-import functools
-from bokeh.client import push_session
-from bokeh.plotting import curdoc
-#end if
-#if not $generate_options().startswith('hb')
-from optparse import OptionParser
-from gnuradio.eng_option import eng_option
-from gnuradio import eng_notation
-#end if</import>
- <make></make>
- <callback>if $run: self.start()
-else: self.stop(); self.wait()</callback>
- <param>
- <name>Title</name>
- <key>title</key>
- <value></value>
- <type>string</type>
- <hide>#if $title() then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Author</name>
- <key>author</key>
- <value></value>
- <type>string</type>
- <hide>#if $author() then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Description</name>
- <key>description</key>
- <value></value>
- <type>string</type>
- <hide>#if $description() then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Canvas Size</name>
- <key>window_size</key>
- <value></value>
- <type>int_vector</type>
- <hide>part</hide>
- </param>
- <param>
- <name>Generate Options</name>
- <key>generate_options</key>
- <value>qt_gui</value>
- <type>enum</type>
- <option>
- <name>Bokeh GUI</name>
- <key>bokeh_gui</key>
- </option>
- <option>
- <name>QT GUI</name>
- <key>qt_gui</key>
- </option>
- <option>
- <name>WX GUI</name>
- <key>wx_gui</key>
- </option>
- <option>
- <name>No GUI</name>
- <key>no_gui</key>
- </option>
- <option>
- <name>Hier Block</name>
- <key>hb</key>
- </option>
- <option>
- <name>Hier Block (QT GUI)</name>
- <key>hb_qt_gui</key>
- </option>
- </param>
- <param>
- <name>Category</name>
- <key>category</key>
- <value>[GRC Hier Blocks]</value>
- <type>string</type>
- <hide>#if $generate_options().startswith('hb') then 'none' else 'all'#</hide>
- </param>
- <param>
- <name>Run Options</name>
- <key>run_options</key>
- <value>prompt</value>
- <type>enum</type>
- <hide>#if $generate_options() == 'no_gui' then 'none' else 'all'#</hide>
- <option>
- <name>Run to Completion</name>
- <key>run</key>
- </option>
- <option>
- <name>Prompt for Exit</name>
- <key>prompt</key>
- </option>
- </param>
- <param>
- <name>Widget Placement</name>
- <key>placement</key>
- <value>(0,0)</value>
- <type>int_vector</type>
- <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
- </param>
- <param>
- <name>Sizing Mode</name>
- <key>sizing_mode</key>
- <value>fixed</value>
- <type>enum</type>
- <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
- <option>
- <name>Fixed</name>
- <key>fixed</key>
- </option>
- <option>
- <name>Stretch Both</name>
- <key>stretch_both</key>
- </option>
- <option>
- <name>Scale Width</name>
- <key>scale_width</key>
- </option>
- <option>
- <name>Scale Height</name>
- <key>scale_height</key>
- </option>
- <option>
- <name>Scale Both</name>
- <key>scale_both</key>
- </option>
- </param>
- <param>
- <name>Run</name>
- <key>run</key>
- <value>True</value>
- <type>bool</type>
- <hide>
-#if $generate_options() in ('qt_gui', 'wx_gui', 'bokeh_gui')
- #if $run()
- part
- #else
- none
- #end if
-#else
- all
-#end if
- </hide>
- <option>
- <name>Autostart</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Max Number of Output</name>
- <key>max_nouts</key>
- <value>0</value>
- <type>int</type>
- <hide>#if $generate_options().startswith('hb')
-all#slurp
-#elif $max_nouts()
-none#slurp
-#else
-part#slurp
-#end if</hide>
- </param>
- <param>
- <name>Realtime Scheduling</name>
- <key>realtime_scheduling</key>
- <value></value>
- <type>enum</type>
- <hide>#if $generate_options().startswith('hb')
-all#slurp
-#elif $realtime_scheduling()
-none#slurp
-#else
-part#slurp
-#end if</hide>
- <option>
- <name>Off</name>
- <key></key>
- </option>
- <option>
- <name>On</name>
- <key>1</key>
- </option>
- </param>
- <param>
- <name>QSS Theme</name>
- <key>qt_qss_theme</key>
- <value></value>
- <type>file_open</type>
- <hide>
-#if $generate_options() in ('qt_gui',)
- #if $qt_qss_theme()
- none
- #else
- part
- #end if
-#else
- all
-#end if
-</hide>
- </param>
- <param>
- <name>Thread-safe setters</name>
- <key>thread_safe_setters</key>
- <value></value>
- <type>enum</type>
- <hide>part</hide>
- <option>
- <name>Off</name>
- <key></key>
- </option>
- <option>
- <name>On</name>
- <key>1</key>
- </option>
- <tab>Advanced</tab>
- </param>
- <param>
- <name>Run Command</name>
- <key>run_command</key>
- <value>{python} -u {filename}</value>
- <type>string</type>
- <hide>#if $generate_options().startswith('hb')
-all#slurp
-#else
-part#slurp
-#end if</hide>
- <tab>Advanced</tab>
- </param>
- <param>
- <name>Hier Block Source Path</name>
- <key>hier_block_src_path</key>
- <value>.:</value>
- <type>string</type>
- <hide>part</hide>
- <tab>Advanced</tab>
- </param>
- <check>not $window_size or len($window_size) == 2</check>
- <check>not $window_size or 300 &lt;= $(window_size)[0] &lt;= 4096</check>
- <check>not $window_size or 300 &lt;= $(window_size)[1] &lt;= 4096</check>
- <check>len($placement) == 4 or len($placement) == 2</check>
- <check>all(i &gt;= 0 for i in $(placement))</check>
- <doc>
-The options block sets special parameters for the flow graph. \
-Only one option block is allowed per flow graph.
-
-Title, author, and description parameters are for identification purposes.
-
-The window size controls the dimensions of the flow graph editor. \
-The window size (width, height) must be between (300, 300) and (4096, 4096).
-
-The generate options controls the type of code generated. \
-Non-graphical flow graphs should avoid using graphical sinks or graphical variable controls.
-
-In a graphical application, \
-run can be controlled by a variable to start and stop the flowgraph at runtime.
-
-The id of this block determines the name of the generated file and the name of the class. \
-For example, an id of my_block will generate the file my_block.py and class my_block(gr....
-
-The category parameter determines the placement of the block in the block selection window. \
-The category only applies when creating hier blocks. \
-To put hier blocks into the root category, enter / for the category.
-
-The Max Number of Output is the maximum number of output items allowed for any block \
-in the flowgraph; to disable this set the max_nouts equal to 0.\
-Use this to adjust the maximum latency a flowgraph can exhibit.
- </doc>
-</block>
--- /dev/null
+++ b/grc/blocks/options.xml
@@ -0,0 +1,294 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Options Block:
+## options for window size,
+## and flow graph building.
+###################################################
+ -->
+<block>
+ <name>Options</name>
+ <key>options</key>
+ <import>from gnuradio import gr</import>
+ <import>from gnuradio.filter import firdes</import>
+ <import>#if $generate_options() == 'wx_gui'
+from grc_gnuradio import wxgui as grc_wxgui
+import wx
+#end if
+#if $generate_options() == 'qt_gui'
+from PyQt5 import Qt
+import sys
+#end if
+#if $generate_options() == 'bokeh_gui'
+import time
+import signal
+import functools
+from bokeh.client import push_session
+from bokeh.plotting import curdoc
+#end if
+#if not $generate_options().startswith('hb')
+from optparse import OptionParser
+from gnuradio.eng_option import eng_option
+from gnuradio import eng_notation
+#end if</import>
+ <make></make>
+ <callback>if $run: self.start()
+else: self.stop(); self.wait()</callback>
+ <param>
+ <name>Title</name>
+ <key>title</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $title() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Author</name>
+ <key>author</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $author() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Description</name>
+ <key>description</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $description() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Canvas Size</name>
+ <key>window_size</key>
+ <value></value>
+ <type>int_vector</type>
+ <hide>part</hide>
+ </param>
+ <param>
+ <name>Generate Options</name>
+ <key>generate_options</key>
+ <value>qt_gui</value>
+ <type>enum</type>
+ <option>
+ <name>Bokeh GUI</name>
+ <key>bokeh_gui</key>
+ </option>
+ <option>
+ <name>QT GUI</name>
+ <key>qt_gui</key>
+ </option>
+ <option>
+ <name>WX GUI</name>
+ <key>wx_gui</key>
+ </option>
+ <option>
+ <name>No GUI</name>
+ <key>no_gui</key>
+ </option>
+ <option>
+ <name>Hier Block</name>
+ <key>hb</key>
+ </option>
+ <option>
+ <name>Hier Block (QT GUI)</name>
+ <key>hb_qt_gui</key>
+ </option>
+ </param>
+ <param>
+ <name>Category</name>
+ <key>category</key>
+ <value>[GRC Hier Blocks]</value>
+ <type>string</type>
+ <hide>#if $generate_options().startswith('hb') then 'none' else 'all'#</hide>
+ </param>
+ <param>
+ <name>Run Options</name>
+ <key>run_options</key>
+ <value>prompt</value>
+ <type>enum</type>
+ <hide>#if $generate_options() == 'no_gui' then 'none' else 'all'#</hide>
+ <option>
+ <name>Run to Completion</name>
+ <key>run</key>
+ </option>
+ <option>
+ <name>Prompt for Exit</name>
+ <key>prompt</key>
+ </option>
+ </param>
+ <param>
+ <name>Widget Placement</name>
+ <key>placement</key>
+ <value>(0,0)</value>
+ <type>int_vector</type>
+ <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
+ </param>
+ <param>
+ <name>Sizing Mode</name>
+ <key>sizing_mode</key>
+ <value>fixed</value>
+ <type>enum</type>
+ <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
+ <option>
+ <name>Fixed</name>
+ <key>fixed</key>
+ </option>
+ <option>
+ <name>Stretch Both</name>
+ <key>stretch_both</key>
+ </option>
+ <option>
+ <name>Scale Width</name>
+ <key>scale_width</key>
+ </option>
+ <option>
+ <name>Scale Height</name>
+ <key>scale_height</key>
+ </option>
+ <option>
+ <name>Scale Both</name>
+ <key>scale_both</key>
+ </option>
+ </param>
+ <param>
+ <name>Run</name>
+ <key>run</key>
+ <value>True</value>
+ <type>bool</type>
+ <hide>
+#if $generate_options() in ('qt_gui', 'wx_gui', 'bokeh_gui')
+ #if $run()
+ part
+ #else
+ none
+ #end if
+#else
+ all
+#end if
+ </hide>
+ <option>
+ <name>Autostart</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Max Number of Output</name>
+ <key>max_nouts</key>
+ <value>0</value>
+ <type>int</type>
+ <hide>#if $generate_options().startswith('hb')
+all#slurp
+#elif $max_nouts()
+none#slurp
+#else
+part#slurp
+#end if</hide>
+ </param>
+ <param>
+ <name>Realtime Scheduling</name>
+ <key>realtime_scheduling</key>
+ <value></value>
+ <type>enum</type>
+ <hide>#if $generate_options().startswith('hb')
+all#slurp
+#elif $realtime_scheduling()
+none#slurp
+#else
+part#slurp
+#end if</hide>
+ <option>
+ <name>Off</name>
+ <key></key>
+ </option>
+ <option>
+ <name>On</name>
+ <key>1</key>
+ </option>
+ </param>
+ <param>
+ <name>QSS Theme</name>
+ <key>qt_qss_theme</key>
+ <value></value>
+ <type>file_open</type>
+ <hide>
+#if $generate_options() in ('qt_gui',)
+ #if $qt_qss_theme()
+ none
+ #else
+ part
+ #end if
+#else
+ all
+#end if
+</hide>
+ </param>
+ <param>
+ <name>Thread-safe setters</name>
+ <key>thread_safe_setters</key>
+ <value></value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Off</name>
+ <key></key>
+ </option>
+ <option>
+ <name>On</name>
+ <key>1</key>
+ </option>
+ <tab>Advanced</tab>
+ </param>
+ <param>
+ <name>Run Command</name>
+ <key>run_command</key>
+ <value>{python} -u {filename}</value>
+ <type>string</type>
+ <hide>#if $generate_options().startswith('hb')
+all#slurp
+#else
+part#slurp
+#end if</hide>
+ <tab>Advanced</tab>
+ </param>
+ <param>
+ <name>Hier Block Source Path</name>
+ <key>hier_block_src_path</key>
+ <value>.:</value>
+ <type>string</type>
+ <hide>part</hide>
+ <tab>Advanced</tab>
+ </param>
+ <check>not $window_size or len($window_size) == 2</check>
+ <check>not $window_size or 300 &lt;= $(window_size)[0] &lt;= 4096</check>
+ <check>not $window_size or 300 &lt;= $(window_size)[1] &lt;= 4096</check>
+ <check>len($placement) == 4 or len($placement) == 2</check>
+ <check>all(i &gt;= 0 for i in $(placement))</check>
+ <doc>
+The options block sets special parameters for the flow graph. \
+Only one option block is allowed per flow graph.
+
+Title, author, and description parameters are for identification purposes.
+
+The window size controls the dimensions of the flow graph editor. \
+The window size (width, height) must be between (300, 300) and (4096, 4096).
+
+The generate options controls the type of code generated. \
+Non-graphical flow graphs should avoid using graphical sinks or graphical variable controls.
+
+In a graphical application, \
+run can be controlled by a variable to start and stop the flowgraph at runtime.
+
+The id of this block determines the name of the generated file and the name of the class. \
+For example, an id of my_block will generate the file my_block.py and class my_block(gr....
+
+The category parameter determines the placement of the block in the block selection window. \
+The category only applies when creating hier blocks. \
+To put hier blocks into the root category, enter / for the category.
+
+The Max Number of Output is the maximum number of output items allowed for any block \
+in the flowgraph; to disable this set the max_nouts equal to 0.\
+Use this to adjust the maximum latency a flowgraph can exhibit.
+ </doc>
+</block>

View File

@ -0,0 +1,375 @@
From d796f30a241ed29831d597ee27df01556a80d2f1 Mon Sep 17 00:00:00 2001
From: Sebastian Koslowski <koslowski@kit.edu>
Date: Tue, 30 Aug 2016 17:52:09 +0200
Subject: [PATCH 14/22] qtgui: replace templated xml files with search and
replace for qt4
---
gr-qtgui/grc/CMakeLists.txt | 32 +++++++++++++++++-----
...ber_sink_b.xml.cmakein => qtgui_ber_sink_b.xml} | 2 +-
...block_tree.xml.cmakein => qtgui_block_tree.xml} | 0
...i_check_box.xml.cmakein => qtgui_check_box.xml} | 2 +-
...qtgui_chooser.xml.cmakein => qtgui_chooser.xml} | 4 +--
...t_sink_x.xml.cmakein => qtgui_const_sink_x.xml} | 2 +-
..._box_msg.xml.cmakein => qtgui_edit_box_msg.xml} | 2 +-
.../{qtgui_entry.xml.cmakein => qtgui_entry.xml} | 2 +-
...eq_sink_x.xml.cmakein => qtgui_freq_sink_x.xml} | 2 +-
...nk_x.xml.cmakein => qtgui_histogram_sink_x.xml} | 2 +-
.../{qtgui_label.xml.cmakein => qtgui_label.xml} | 2 +-
...mber_sink.xml.cmakein => qtgui_number_sink.xml} | 2 +-
...sh_button.xml.cmakein => qtgui_push_button.xml} | 2 +-
.../{qtgui_range.xml.cmakein => qtgui_range.xml} | 0
.../{qtgui_sink_x.xml.cmakein => qtgui_sink_x.xml} | 2 +-
...tab_widget.xml.cmakein => qtgui_tab_widget.xml} | 2 +-
...aster_x.xml.cmakein => qtgui_time_raster_x.xml} | 2 +-
...me_sink_x.xml.cmakein => qtgui_time_sink_x.xml} | 2 +-
..._sink_f.xml.cmakein => qtgui_vector_sink_f.xml} | 2 +-
...nk_x.xml.cmakein => qtgui_waterfall_sink_x.xml} | 2 +-
20 files changed, 43 insertions(+), 25 deletions(-)
rename gr-qtgui/grc/{qtgui_ber_sink_b.xml.cmakein => qtgui_ber_sink_b.xml} (99%)
rename gr-qtgui/grc/{qtgui_block_tree.xml.cmakein => qtgui_block_tree.xml} (100%)
rename gr-qtgui/grc/{qtgui_check_box.xml.cmakein => qtgui_check_box.xml} (97%)
rename gr-qtgui/grc/{qtgui_chooser.xml.cmakein => qtgui_chooser.xml} (98%)
rename gr-qtgui/grc/{qtgui_const_sink_x.xml.cmakein => qtgui_const_sink_x.xml} (99%)
rename gr-qtgui/grc/{qtgui_edit_box_msg.xml.cmakein => qtgui_edit_box_msg.xml} (98%)
rename gr-qtgui/grc/{qtgui_entry.xml.cmakein => qtgui_entry.xml} (97%)
rename gr-qtgui/grc/{qtgui_freq_sink_x.xml.cmakein => qtgui_freq_sink_x.xml} (99%)
rename gr-qtgui/grc/{qtgui_histogram_sink_x.xml.cmakein => qtgui_histogram_sink_x.xml} (99%)
rename gr-qtgui/grc/{qtgui_label.xml.cmakein => qtgui_label.xml} (97%)
rename gr-qtgui/grc/{qtgui_number_sink.xml.cmakein => qtgui_number_sink.xml} (99%)
rename gr-qtgui/grc/{qtgui_push_button.xml.cmakein => qtgui_push_button.xml} (97%)
rename gr-qtgui/grc/{qtgui_range.xml.cmakein => qtgui_range.xml} (100%)
rename gr-qtgui/grc/{qtgui_sink_x.xml.cmakein => qtgui_sink_x.xml} (98%)
rename gr-qtgui/grc/{qtgui_tab_widget.xml.cmakein => qtgui_tab_widget.xml} (99%)
rename gr-qtgui/grc/{qtgui_time_raster_x.xml.cmakein => qtgui_time_raster_x.xml} (99%)
rename gr-qtgui/grc/{qtgui_time_sink_x.xml.cmakein => qtgui_time_sink_x.xml} (99%)
rename gr-qtgui/grc/{qtgui_vector_sink_f.xml.cmakein => qtgui_vector_sink_f.xml} (99%)
rename gr-qtgui/grc/{qtgui_waterfall_sink_x.xml.cmakein => qtgui_waterfall_sink_x.xml} (99%)
diff --git a/gr-qtgui/grc/CMakeLists.txt b/gr-qtgui/grc/CMakeLists.txt
index d01bcc52c4..74e6958639 100644
--- a/gr-qtgui/grc/CMakeLists.txt
+++ b/gr-qtgui/grc/CMakeLists.txt
@@ -18,12 +18,30 @@
# Boston, MA 02110-1301, USA.
########################################################################
-file(GLOB xml_cmakein_files "*.xml.cmakein")
+file(GLOB xml_files "*.xml")
-foreach(xml_cmakein_file IN ITEMS ${xml_cmakein_files})
- get_filename_component(FILE_NAME ${xml_cmakein_file} NAME_WE)
- configure_file(${xml_cmakein_file} "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.xml" @ONLY)
- set(xml_files ${xml_files} "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.xml")
-endforeach(xml_cmakein_file)
+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}")
-install(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "qtgui_python")
+ 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.cmakein b/gr-qtgui/grc/qtgui_ber_sink_b.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_ber_sink_b.xml.cmakein
rename to gr-qtgui/grc/qtgui_ber_sink_b.xml
index 91a87ce595..05a36dfbc0 100644
--- a/gr-qtgui/grc/qtgui_ber_sink_b.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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_block_tree.xml.cmakein b/gr-qtgui/grc/qtgui_block_tree.xml
similarity index 100%
rename from gr-qtgui/grc/qtgui_block_tree.xml.cmakein
rename to gr-qtgui/grc/qtgui_block_tree.xml
diff --git a/gr-qtgui/grc/qtgui_check_box.xml.cmakein b/gr-qtgui/grc/qtgui_check_box.xml
similarity index 97%
rename from gr-qtgui/grc/qtgui_check_box.xml.cmakein
rename to gr-qtgui/grc/qtgui_check_box.xml
index 9edacb24d8..ccee59dd92 100644
--- a/gr-qtgui/grc/qtgui_check_box.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_chooser.xml
similarity index 98%
rename from gr-qtgui/grc/qtgui_chooser.xml.cmakein
rename to gr-qtgui/grc/qtgui_chooser.xml
index 40c782bede..f79bb8ccb3 100644
--- a/gr-qtgui/grc/qtgui_chooser.xml.cmakein
+++ b/gr-qtgui/grc/qtgui_chooser.xml
@@ -8,8 +8,8 @@
<block>
<name>QT GUI Chooser</name>
<key>variable_qtgui_chooser</key>
- <import>from PyQt@DESIRED_QT_VERSION@ import Qt</import>
- <import>from PyQt@DESIRED_QT_VERSION@.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.cmakein b/gr-qtgui/grc/qtgui_const_sink_x.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_const_sink_x.xml.cmakein
rename to gr-qtgui/grc/qtgui_const_sink_x.xml
index 6fa725acb1..10f82cce82 100644
--- a/gr-qtgui/grc/qtgui_const_sink_x.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_edit_box_msg.xml
similarity index 98%
rename from gr-qtgui/grc/qtgui_edit_box_msg.xml.cmakein
rename to gr-qtgui/grc/qtgui_edit_box_msg.xml
index 75ff93349f..d77a4b3e1b 100644
--- a/gr-qtgui/grc/qtgui_edit_box_msg.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_entry.xml
similarity index 97%
rename from gr-qtgui/grc/qtgui_entry.xml.cmakein
rename to gr-qtgui/grc/qtgui_entry.xml
index da61ee723a..fc0f4089d1 100644
--- a/gr-qtgui/grc/qtgui_entry.xml.cmakein
+++ b/gr-qtgui/grc/qtgui_entry.xml
@@ -8,7 +8,7 @@
<block>
<name>QT GUI Entry</name>
<key>variable_qtgui_entry</key>
- <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_freq_sink_x.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_freq_sink_x.xml.cmakein
rename to gr-qtgui/grc/qtgui_freq_sink_x.xml
index aaf0d75271..ed39db7781 100644
--- a/gr-qtgui/grc/qtgui_freq_sink_x.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_histogram_sink_x.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_histogram_sink_x.xml.cmakein
rename to gr-qtgui/grc/qtgui_histogram_sink_x.xml
index d04a44da13..9e3dcb104f 100644
--- a/gr-qtgui/grc/qtgui_histogram_sink_x.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_label.xml
similarity index 97%
rename from gr-qtgui/grc/qtgui_label.xml.cmakein
rename to gr-qtgui/grc/qtgui_label.xml
index c546e09dcc..946cee36ab 100644
--- a/gr-qtgui/grc/qtgui_label.xml.cmakein
+++ b/gr-qtgui/grc/qtgui_label.xml
@@ -9,7 +9,7 @@
<block>
<name>QT GUI Label</name>
<key>variable_qtgui_label</key>
- <import>from PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_number_sink.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_number_sink.xml.cmakein
rename to gr-qtgui/grc/qtgui_number_sink.xml
index d4b4c5808f..06837493c3 100644
--- a/gr-qtgui/grc/qtgui_number_sink.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_push_button.xml
similarity index 97%
rename from gr-qtgui/grc/qtgui_push_button.xml.cmakein
rename to gr-qtgui/grc/qtgui_push_button.xml
index d99f230acf..49c2e9d6f0 100644
--- a/gr-qtgui/grc/qtgui_push_button.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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_range.xml.cmakein b/gr-qtgui/grc/qtgui_range.xml
similarity index 100%
rename from gr-qtgui/grc/qtgui_range.xml.cmakein
rename to gr-qtgui/grc/qtgui_range.xml
diff --git a/gr-qtgui/grc/qtgui_sink_x.xml.cmakein b/gr-qtgui/grc/qtgui_sink_x.xml
similarity index 98%
rename from gr-qtgui/grc/qtgui_sink_x.xml.cmakein
rename to gr-qtgui/grc/qtgui_sink_x.xml
index 1c75921a75..a9bc469cd2 100644
--- a/gr-qtgui/grc/qtgui_sink_x.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_tab_widget.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_tab_widget.xml.cmakein
rename to gr-qtgui/grc/qtgui_tab_widget.xml
index f5a1a73cdc..805542cc8b 100644
--- a/gr-qtgui/grc/qtgui_tab_widget.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_time_raster_x.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_time_raster_x.xml.cmakein
rename to gr-qtgui/grc/qtgui_time_raster_x.xml
index 94b7ef136a..d458f67eb9 100644
--- a/gr-qtgui/grc/qtgui_time_raster_x.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_time_sink_x.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_time_sink_x.xml.cmakein
rename to gr-qtgui/grc/qtgui_time_sink_x.xml
index d239917907..d4347950ea 100644
--- a/gr-qtgui/grc/qtgui_time_sink_x.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_vector_sink_f.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_vector_sink_f.xml.cmakein
rename to gr-qtgui/grc/qtgui_vector_sink_f.xml
index 8b928eb7ea..0f456323bf 100644
--- a/gr-qtgui/grc/qtgui_vector_sink_f.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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.cmakein b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
similarity index 99%
rename from gr-qtgui/grc/qtgui_waterfall_sink_x.xml.cmakein
rename to gr-qtgui/grc/qtgui_waterfall_sink_x.xml
index d198ca084a..a684492246 100644
--- a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml.cmakein
+++ 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 PyQt@DESIRED_QT_VERSION@ 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>
--
2.11.0

View File

@ -0,0 +1,25 @@
From ae10f7b4f1ec25fc2e800d42a061603a08c0283b Mon Sep 17 00:00:00 2001
From: Bastian Bloessl <bloessl@ccs-labs.org>
Date: Fri, 11 Nov 2016 13:27:55 +0100
Subject: [PATCH 17/22] qtgui: fix stylesheet for qt5
---
gr-qtgui/python/qtgui/util.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gr-qtgui/python/qtgui/util.py b/gr-qtgui/python/qtgui/util.py
index d2e9495ac6..fffc482615 100644
--- a/gr-qtgui/python/qtgui/util.py
+++ b/gr-qtgui/python/qtgui/util.py
@@ -25,7 +25,7 @@ from PyQt4 import Qt, QtCore, QtGui
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:
--
2.11.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,61 @@
From b12439f3f600b9d0be03189e8a82310d9ceabdd6 Mon Sep 17 00:00:00 2001
From: "A. Maitland Bottoms" <bottoms@debian.org>
Date: Sun, 25 Feb 2018 13:27:38 -0500
Subject: [PATCH 21/22] gnuradio runtime ctrlport qt5
---
gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py | 4 ++--
gnuradio-runtime/python/gnuradio/ctrlport/gr-ctrlport-monitor | 4 ++--
gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py b/gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py
index c5bfd0a8cb..6d78565b3b 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py
@@ -28,10 +28,10 @@ import sys, time, struct
try:
from gnuradio import qtgui
- from PyQt4 import QtGui, QtCore
+ from PyQt5 import QtGui, QtCore
import sip
except ImportError:
- print "Error: Program requires PyQt4 and gr-qtgui."
+ sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
sys.exit(1)
class GrDataPlotParent(gr.top_block, QtGui.QWidget):
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/gr-ctrlport-monitor b/gnuradio-runtime/python/gnuradio/ctrlport/gr-ctrlport-monitor
index c866776355..ce53c60c0e 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/gr-ctrlport-monitor
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/gr-ctrlport-monitor
@@ -20,8 +20,8 @@
# Boston, MA 02110-1301, USA.
#
-from PyQt4 import QtCore,Qt
-import PyQt4.QtGui as QtGui
+from PyQt5 import QtCore,Qt
+import PyQt5.QtGui as QtGui
import os, sys, time, struct
from gnuradio import gr, ctrlport
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx b/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
index 15a2153a0f..a9e43bff41 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
@@ -46,8 +46,8 @@ except ImportError:
"Please check that they are installed and try again."
sys.exit(1)
-from PyQt4 import QtCore,Qt
-import PyQt4.QtGui as QtGui
+from PyQt5 import QtCore,Qt
+import PyQt5.QtGui as QtGui
import itertools
from gnuradio import gr, ctrlport
--
2.11.0

View File

@ -0,0 +1,72 @@
From 18f5edf38cc6a24836f943d6976d913a4f35cab3 Mon Sep 17 00:00:00 2001
From: "A. Maitland Bottoms" <bottoms@debian.org>
Date: Sun, 25 Feb 2018 13:28:05 -0500
Subject: [PATCH 22/22] gr uhd qt5
---
gr-uhd/apps/uhd_fft | 8 ++++----
gr-uhd/apps/uhd_siggen_gui | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
--- a/gr-uhd/apps/uhd_fft
+++ b/gr-uhd/apps/uhd_fft
@@ -40,7 +40,7 @@
import threading
import time
from distutils.version import StrictVersion
-from PyQt4 import Qt
+from PyQt5 import Qt
from gnuradio import eng_notation
from gnuradio import eng_arg
from gnuradio import gr
@@ -478,8 +478,8 @@
Go, go, go!
"""
args = setup_argparser().parse_args()
- if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
- Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui','style','raster'))
+ #if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
+ # Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui','style','raster'))
qapp = Qt.QApplication(sys.argv)
tb = uhd_fft(args)
tb.start()
@@ -487,7 +487,7 @@
def quitting():
tb.stop()
tb.wait()
- qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
+ qapp.aboutToQuit.connect(quitting)
qapp.exec_()
tb = None #to clean up Qt widgets
--- a/gr-uhd/apps/uhd_siggen_gui
+++ b/gr-uhd/apps/uhd_siggen_gui
@@ -38,8 +38,8 @@
import threading
import time
from distutils.version import StrictVersion
-from PyQt4 import Qt
-from PyQt4.QtCore import pyqtSlot
+from PyQt5 import Qt
+from PyQt5.QtCore import pyqtSlot
from gnuradio import analog
from gnuradio import eng_notation
from gnuradio import gr
@@ -448,14 +448,14 @@
""" Go, go, go! """
parser = setup_parser()
args = parser.parse_args()
- if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
- Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui', 'style', 'raster'))
+ #if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
+ # Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui', 'style', 'raster'))
qapp = Qt.QApplication(sys.argv)
siggen_gui = uhd_siggen_gui(args)
siggen_gui.show()
def quitting():
siggen_gui.stop()
- qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
+ qapp.aboutToQuit.connect(quitting)
qapp.exec_()
siggen_gui = None #to clean up Qt widgets

View File

@ -0,0 +1,39 @@
From af4ab4e0f745ef3d61effc71824b09d0c15d8b86 Mon Sep 17 00:00:00 2001
From: "A. Maitland Bottoms" <bottoms@debian.org>
Date: Mon, 26 Feb 2018 21:36:29 -0500
Subject: [PATCH] gr qtgui util
---
gr-qtgui/python/qtgui/util.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/gr-qtgui/python/qtgui/util.py b/gr-qtgui/python/qtgui/util.py
index fffc482615..ca9f6f5035 100644
--- a/gr-qtgui/python/qtgui/util.py
+++ b/gr-qtgui/python/qtgui/util.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright 2016 Free Software Foundation, Inc.
+# Copyright 2016,2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,7 @@
# Boston, MA 02110-1301, USA.
#
-from PyQt4 import Qt, QtCore, QtGui
+from PyQt5 import Qt, QtCore, QtGui, QtWidgets
from gnuradio import gr
def check_set_qss():
@@ -32,4 +32,3 @@ def check_set_qss():
app.setStyleSheet(open(qssfile).read())
except:
print "WARNING: bad QSS file, %s"%(qssfile)
-
--
2.11.0

View File

@ -0,0 +1,85 @@
From b65bf73bc174183d6aec476c2fb161a4911c2351 Mon Sep 17 00:00:00 2001
From: Vasil Velichkov <vvvelichkov@gmail.com>
Date: Thu, 11 Jan 2018 00:32:37 +0000
Subject: [PATCH 27/27] Fix AttributeError: 'NoneType' object has no attribute
'toByteArray'
Debian Bug #886807
---
gr-uhd/apps/uhd_fft | 6 +++---
gr-uhd/apps/uhd_siggen_gui | 4 ++--
grc/blocks/options.xml | 2 +-
grc/core/generator/flow_graph.tmpl | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
--- a/gr-uhd/apps/uhd_fft
+++ b/gr-uhd/apps/uhd_fft
@@ -40,7 +40,7 @@
import threading
import time
from distutils.version import StrictVersion
-from PyQt5 import Qt
+from PyQt5 import Qt, QtCore
from gnuradio import eng_notation
from gnuradio import eng_arg
from gnuradio import gr
@@ -60,7 +60,7 @@
"""
def __init__(self, args):
gr.top_block.__init__(self, "UHD FFT")
- Qt.QWidget.__init__(self)
+ Qt.QWidget.__init__(self, args=args)
UHDApp.__init__(self, args=args, prefix="UHD FFT")
##################################################
# Init QT App
@@ -82,7 +82,7 @@
self.top_grid_layout = Qt.QGridLayout()
self.top_layout.addLayout(self.top_grid_layout)
self.settings = Qt.QSettings("GNU Radio", "uhd_fft")
- self.restoreGeometry(self.settings.value("geometry").toByteArray())
+ self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray))
##################################################
# Parameters
--- a/gr-uhd/apps/uhd_siggen_gui
+++ b/gr-uhd/apps/uhd_siggen_gui
@@ -39,7 +39,7 @@
import time
from distutils.version import StrictVersion
from PyQt5 import Qt
-from PyQt5.QtCore import pyqtSlot
+from PyQt5.QtCore import pyqtSlot, QByteArray
from gnuradio import analog
from gnuradio import eng_notation
from gnuradio import gr
@@ -85,7 +85,7 @@
self.top_grid_layout = Qt.QGridLayout()
self.top_layout.addLayout(self.top_grid_layout)
self.settings = Qt.QSettings("GNU Radio", "uhd_siggen_gui")
- self.restoreGeometry(self.settings.value("geometry").toByteArray())
+ self.restoreGeometry(self.settings.value("geometry", type=QByteArray))
##################################################
# Widgets + Controls
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -16,7 +16,7 @@
import wx
#end if
#if $generate_options() == 'qt_gui'
-from PyQt5 import Qt
+from PyQt5 import Qt, QtCore
import sys
#end if
#if $generate_options() == 'bokeh_gui'
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -122,7 +122,7 @@
self.top_layout.addLayout(self.top_grid_layout)
self.settings = Qt.QSettings("GNU Radio", "$class_name")
- self.restoreGeometry(self.settings.value("geometry"))
+ self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray))
#elif $generate_options == 'bokeh_gui'