From da2a0ee103f6890ad424c102e45874bb2cf121b99d77ffa4e27bfd8d7ed31b3f Mon Sep 17 00:00:00 2001 From: Wojciech Kazubski Date: Fri, 20 Sep 2019 11:59:02 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/hardware:sdr/gnuradio?expand=0&rev=52 --- qt5-maint-0003-gr-qtgui-update-for-Qt5.patch | 575 +++++++++++++++++++ 1 file changed, 575 insertions(+) create mode 100644 qt5-maint-0003-gr-qtgui-update-for-Qt5.patch diff --git a/qt5-maint-0003-gr-qtgui-update-for-Qt5.patch b/qt5-maint-0003-gr-qtgui-update-for-Qt5.patch new file mode 100644 index 0000000..919a2dd --- /dev/null +++ b/qt5-maint-0003-gr-qtgui-update-for-Qt5.patch @@ -0,0 +1,575 @@ +From 1f78d5f2176de31809dc34fb38945c181390cdef Mon Sep 17 00:00:00 2001 +From: Paul Cercueil +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 +--- + 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 @@ + + QT GUI Bercurve Sink + qtgui_bercurve_sink +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + import sip + import numpy +--- a/gr-qtgui/grc/qtgui_check_box.xml ++++ b/gr-qtgui/grc/qtgui_check_box.xml +@@ -8,7 +8,7 @@ + + QT GUI Check Box + variable_qtgui_check_box +- from PyQt4 import Qt ++ from PyQt5 import Qt + self.$(id) = $(id) = $value + #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 @@ + + QT GUI Chooser + variable_qtgui_chooser +- from PyQt4 import Qt +- from PyQt4.QtCore import QObject, pyqtSlot ++ from PyQt5 import Qt ++ from PyQt5.QtCore import QObject, pyqtSlot + self.$(id) = $(id) = $value + #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 @@ + + QT GUI Constellation Sink + qtgui_const_sink_x +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + import sip + #set $win = 'self._%s_win'%$id +--- a/gr-qtgui/grc/qtgui_entry.xml ++++ b/gr-qtgui/grc/qtgui_entry.xml +@@ -8,7 +8,7 @@ + + QT GUI Entry + variable_qtgui_entry +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import eng_notation + self.$(id) = $(id) = $value + #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 @@ + + QT GUI Frequency Sink + qtgui_freq_sink_x +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip +--- a/gr-qtgui/grc/qtgui_histogram_sink_x.xml ++++ b/gr-qtgui/grc/qtgui_histogram_sink_x.xml +@@ -7,7 +7,7 @@ + + QT GUI Histogram Sink + qtgui_histogram_sink_x +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + import sip + #set $win = 'self._%s_win'%$id +--- a/gr-qtgui/grc/qtgui_label.xml ++++ b/gr-qtgui/grc/qtgui_label.xml +@@ -9,7 +9,7 @@ + + QT GUI Label + variable_qtgui_label +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import eng_notation + self.$(id) = $(id) = $value + #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 @@ + + QT GUI Number Sink + qtgui_number_sink +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + import sip + #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 @@ + + QT GUI Push Button + variable_qtgui_push_button +- from PyQt4 import Qt ++ from PyQt5 import Qt + self.$(id) = $(id) = $value + #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 @@ + + QT GUI Sink + qtgui_sink_x +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip +--- a/gr-qtgui/grc/qtgui_tab_widget.xml ++++ b/gr-qtgui/grc/qtgui_tab_widget.xml +@@ -7,7 +7,7 @@ + + QT GUI Tab Widget + qtgui_tab_widget +- from PyQt4 import Qt ++ from PyQt5 import Qt + #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 @@ + + QT GUI Time Raster Sink + qtgui_time_raster_sink_x +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + import sip + #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 @@ + + QT GUI Time Sink + qtgui_time_sink_x +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip +--- a/gr-qtgui/grc/qtgui_vector_sink_f.xml ++++ b/gr-qtgui/grc/qtgui_vector_sink_f.xml +@@ -7,7 +7,7 @@ + + QT GUI Vector Sink + qtgui_vector_sink_f +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + import sip + #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 @@ + + QT GUI Waterfall Sink + qtgui_waterfall_sink_x +- from PyQt4 import Qt ++ from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip +--- a/gr-qtgui/include/gnuradio/qtgui/form_menus.h ++++ b/gr-qtgui/include/gnuradio/qtgui/form_menus.h +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- 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 .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 + //Added by qt3to4: + #include +-#include + #include + + 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 +