Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.

Commit cb88c5f

Browse files
authored
Migrate to PyQt6 (#1072)
1 parent fea9d72 commit cb88c5f

213 files changed

Lines changed: 69788 additions & 76087 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ubuntu-latest]
19-
python-version: ['3.9', '3.10', '3.11', '3.12']
19+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
2020
architecture: [x64]
2121
include:
2222
- os: windows-latest
23-
python-version: '3.12'
24-
architecture: x86
25-
- os: windows-latest
26-
python-version: '3.12'
23+
python-version: '3.13'
2724
architecture: x64
28-
- os: macOS-13
29-
python-version: '3.12'
25+
- os: macos-15-intel
26+
python-version: '3.13'
3027
architecture: x64
3128
fail-fast: false
3229

@@ -57,7 +54,7 @@ jobs:
5754
if [[ $OS == ubuntu* ]]
5855
then
5956
sudo apt-get update
60-
sudo apt-get install libhackrf-dev librtlsdr-dev xvfb libxkbcommon-x11-0 x11-utils libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0
57+
sudo apt-get install libhackrf-dev librtlsdr-dev xvfb libxkbcommon-x11-0 x11-utils libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libegl1 libxcb-cursor0
6158
pip install PyVirtualDisplay==0.2.5
6259
elif [[ $OS == windows* ]]
6360
then
@@ -100,8 +97,8 @@ jobs:
10097
if: startsWith(matrix.os, 'ubuntu')
10198
run: |
10299
docker run --rm \
103-
-e PYVER=$(python -c "import sys; print('%s%s' % (sys.version_info.major, sys.version_info.minor))") \
104-
-v `pwd`:/io jopohl/urh_manylinux2_28 /io/data/make_manylinux_wheels.sh
100+
-e PYVER=$(python -c "import sys; print('cp{0}{1}-cp{0}{1}'.format(sys.version_info.major, sys.version_info.minor))") \
101+
-v `pwd`:/io jopohl/urh_manylinux2_34_x86_64:2025.12.07-2 /io/data/make_manylinux_wheels.sh
105102
106103
- name: Check wheel
107104
if: startsWith(matrix.os, 'ubuntu')

data/build_icons.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Build Qt Resource File from custom Icon Theme for Windows
2+
import fileinput
23
import os
34

45
import shutil
@@ -81,7 +82,21 @@ def copy_icons(icon_names: set):
8182

8283
tree = ET.ElementTree(root)
8384
tree.write("/tmp/xtra_icons.qrc")
84-
call(["pyrcc5", "/tmp/xtra_icons.qrc", "-o", "/tmp/xtra_icons_rc.py"])
85+
call(
86+
[
87+
"pyside6-rcc",
88+
"-g",
89+
"python",
90+
"/tmp/xtra_icons.qrc",
91+
"-o",
92+
"/tmp/xtra_icons_rc.py",
93+
]
94+
)
95+
for line in fileinput.input("/tmp/xtra_icons_rc.py", inplace=True):
96+
print(
97+
line.replace("from PySide6 import QtCore", "from PyQt6 import QtCore"),
98+
end="",
99+
)
85100
tar_path = os.path.dirname(os.path.join(os.path.dirname(__file__), "..", ".."))
86101
tar_path = os.path.join(tar_path, "src/urh/ui")
87102
shutil.copy("/tmp/xtra_icons_rc.py", tar_path)

data/generate_ui.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
def gen(force=False):
88
if sys.platform == "win32":
9-
bindir = r"c:\Python34\Lib\site-packages\PyQt5"
9+
bindir = r"c:\Python34\Lib\site-packages\PyQt6"
1010
else:
1111
bindir = "/usr/bin"
1212

1313
if sys.platform == "win32":
14-
uic_path = os.path.join(bindir, "pyuic5.bat")
15-
rcc_path = os.path.join(bindir, "pyrcc5.exe")
14+
uic_path = os.path.join(bindir, "pyuic6.bat")
15+
rcc_path = os.path.join(bindir, "pyside6-rcc.exe")
1616
else:
17-
uic_path = os.path.join(bindir, "pyuic5")
18-
rcc_path = os.path.join(bindir, "pyrcc5")
17+
uic_path = os.path.join(bindir, "pyuic6")
18+
rcc_path = os.path.join(bindir, "rcc")
1919

2020
file_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "ui")
2121
ui_path = file_dir
@@ -39,7 +39,7 @@ def gen(force=False):
3939
# Generated file is already there and newer than ui file, no need to recompile it
4040
continue
4141

42-
call([uic_path, "--from-imports", file_path, "-o", out_file_path])
42+
call([uic_path, file_path, "-o", out_file_path])
4343

4444
# Remove Line: # Form implementation generated from reading ui file '/home/joe/GIT/urh/ui/fuzzing.ui'
4545
# to avoid useless git updates when working on another computer
@@ -65,8 +65,16 @@ def gen(force=False):
6565
time_generated_file = 0
6666

6767
if time_generated_file < time_rc_file or force:
68-
# Only create, when generated file is old than rc file to prevent unneeded git pushes
69-
call([rcc_path, file_path, "-o", out_file_path])
68+
print(file_path)
69+
# Only create, when generated file is older than rc file to prevent unneeded git pushes
70+
call([rcc_path, "-g", "python", file_path, "-o", out_file_path])
71+
for line in fileinput.input(out_file_path, inplace=True):
72+
print(
73+
line.replace(
74+
"from PySide2 import QtCore", "from PyQt6 import QtCore"
75+
),
76+
end="",
77+
)
7078

7179

7280
if __name__ == "__main__":

data/make_manylinux_wheels.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/:/usr/local/lib/:/usr/l
55

66

77
touch /tmp/urh_releasing
8-
for PYBIN in /opt/python/*$PYVER*/bin; do # for all if PYVER not set
8+
for PYBIN in /opt/python/$PYVER/bin; do
99
echo -e "\033[1mInstalling requirements for $PYBIN\033[0m"
1010
"${PYBIN}/pip" install -r /io/data/requirements.txt
1111

1212
cd /io || return
13-
echo -e "\033[1mBuilding extentions for $PYBIN\033[0m"
13+
echo -e "\033[1mBuilding extensions for $PYBIN\033[0m"
1414
"${PYBIN}/python3" setup.py build_ext "-j$(nproc)"
1515

1616
echo -e "\033[1mBuilding wheel for $PYBIN\033[0m"
17-
"${PYBIN}/pip" wheel --no-deps /io/ -w /wheelhouse/
17+
"${PYBIN}/pip" wheel --no-deps --no-build-isolation /io/ -w /wheelhouse/
1818
done
1919

2020
# Bundle external libs into wheels

data/manylinux.Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM quay.io/pypa/manylinux_2_28_x86_64
1+
FROM quay.io/pypa/manylinux_2_34_x86_64:2025.12.07-1
22

3-
RUN yum -y install wget blas libusb-devel fftw-devel cmake3 boost-devel https://github.com/analogdevicesinc/libiio/releases/download/v0.19/libiio-0.19.g5f5af2e-centos-7-x86_64.rpm
3+
RUN yum -y install wget blas libusb-devel fftw-devel cmake3 boost-devel https://github.com/analogdevicesinc/libiio/releases/download/v0.26/libiio-0.26.ga0eca0d-Linux-Fedora-28.rpm
44
RUN export AIRSPY_VERSION="1.0.9" \
55
&& export BLADERF_VERSION="2022.11" \
6-
&& export LIMESUITE_VERSION="20.01.0" \
6+
&& export LIMESUITE_VERSION="23.11.0" \
77
&& export HACKRF_VERSION="v2023.01.1" \
88
&& export SDRPLAY_VERSION="2.13" \
99
&& export RTLSDR_VERSION="0.6.0" \
@@ -16,7 +16,7 @@ RUN export AIRSPY_VERSION="1.0.9" \
1616
# UHD
1717
&& wget https://github.com/EttusResearch/uhd/archive/v$UHD_VERSION.tar.gz -O /tmp/uhd.tar.gz \
1818
&& tar xf /tmp/uhd.tar.gz -C /tmp \
19-
&& python3.10 -m pip install mako \
19+
&& python3.12 -m pip install mako requests numpy ruamel.yaml \
2020
&& cmake3 -DBOOST_INCLUDEDIR=/usr/include/boost/ -DBOOST_LIBRARYDIR=/usr/lib64/boost/ -DENABLE_EXAMPLES=OFF -DENABLE_UTILS=OFF -DENABLE_C_API=ON -DENABLE_TESTS=OFF -DENABLE_MAN_PAGES=OFF -S /tmp/uhd-$UHD_VERSION/host -B /tmp/build_uhd \
2121
&& make -j$(nproc) -C /tmp/build_uhd \
2222
&& make -C /tmp/build_uhd install \
@@ -28,19 +28,19 @@ RUN export AIRSPY_VERSION="1.0.9" \
2828
&& make -C /tmp/build_airspy install \
2929
# BladeRF
3030
&& git clone --branch $BLADERF_VERSION --recursive https://github.com/Nuand/bladeRF /tmp/bladeRF-$BLADERF_VERSION \
31-
&& cmake -S /tmp/bladeRF-$BLADERF_VERSION/host -B /tmp/build_blade \
31+
&& cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_C_FLAGS="-Wno-maybe-uninitialized -Wno-calloc-transposed-args" -S /tmp/bladeRF-$BLADERF_VERSION/host -B /tmp/build_blade \
3232
&& make -j$(nproc) -C /tmp/build_blade \
3333
&& make -C /tmp/build_blade install \
3434
# Lime
3535
&& wget https://github.com/myriadrf/LimeSuite/archive/v$LIMESUITE_VERSION.tar.gz -O /tmp/lime.tar.gz \
3636
&& tar xf /tmp/lime.tar.gz -C /tmp \
37-
&& cmake -S /tmp/LimeSuite-$LIMESUITE_VERSION -B /tmp/build_lime \
37+
&& cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -S /tmp/LimeSuite-$LIMESUITE_VERSION -B /tmp/build_lime \
3838
&& make -j$(nproc) -C /tmp/build_lime \
3939
&& make -C /tmp/build_lime install \
4040
# RTLSDR
4141
&& wget https://github.com/osmocom/rtl-sdr/archive/$RTLSDR_VERSION.tar.gz -O /tmp/rtlsdr.tar.gz \
4242
&& tar xf /tmp/rtlsdr.tar.gz -C /tmp \
43-
&& cmake -DDETACH_KERNEL_DRIVER=ON -S /tmp/rtl-sdr-$RTLSDR_VERSION -B /tmp/build_rtlsdr \
43+
&& cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DDETACH_KERNEL_DRIVER=ON -S /tmp/rtl-sdr-$RTLSDR_VERSION -B /tmp/build_rtlsdr \
4444
&& make -j$(nproc) -C /tmp/build_rtlsdr \
4545
&& make -C /tmp/build_rtlsdr install \
4646
# SDRPLAY

data/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
numpy<3.0
2-
pyqt5
2+
PyQt6
33
psutil
44
cython
55
setuptools

data/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ parts:
136136
- libpulse-mainloop-glib0
137137
- libspeechd2
138138
- python3
139-
- python3-pyqt5
139+
- python3-pyqt6
140140
- python3-pyaudio
141141
- dbus
142142
- qtwayland5

data/ui/modulation.ui

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<x>0</x>
7777
<y>0</y>
7878
<width>965</width>
79-
<height>984</height>
79+
<height>989</height>
8080
</rect>
8181
</property>
8282
<layout class="QGridLayout" name="gridLayout_7" rowstretch="0,1,0,1,0,1,0,0,1,0,0" columnstretch="0,0,0,0">
@@ -220,10 +220,7 @@
220220
<enum>Qt::ScrollBarAlwaysOn</enum>
221221
</property>
222222
<property name="renderHints">
223-
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing</set>
224-
</property>
225-
<property name="dragMode">
226-
<enum>QGraphicsView::NoDrag</enum>
223+
<set>QPainter::Antialiasing</set>
227224
</property>
228225
</widget>
229226
</item>
@@ -240,8 +237,8 @@
240237
<rect>
241238
<x>0</x>
242239
<y>0</y>
243-
<width>373</width>
244-
<height>330</height>
240+
<width>313</width>
241+
<height>316</height>
245242
</rect>
246243
</property>
247244
<layout class="QGridLayout" name="gridLayout_4">
@@ -485,8 +482,8 @@
485482
<rect>
486483
<x>0</x>
487484
<y>0</y>
488-
<width>373</width>
489-
<height>141</height>
485+
<width>313</width>
486+
<height>149</height>
490487
</rect>
491488
</property>
492489
<layout class="QGridLayout" name="gridLayout_2">
@@ -594,8 +591,8 @@
594591
<rect>
595592
<x>0</x>
596593
<y>0</y>
597-
<width>353</width>
598-
<height>143</height>
594+
<width>313</width>
595+
<height>148</height>
599596
</rect>
600597
</property>
601598
<layout class="QGridLayout" name="gridLayout">
@@ -748,10 +745,7 @@
748745
<enum>Qt::ScrollBarAlwaysOn</enum>
749746
</property>
750747
<property name="renderHints">
751-
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing</set>
752-
</property>
753-
<property name="dragMode">
754-
<enum>QGraphicsView::NoDrag</enum>
748+
<set>QPainter::Antialiasing</set>
755749
</property>
756750
</widget>
757751
</item>
@@ -786,10 +780,7 @@
786780
<enum>Qt::ScrollBarAlwaysOn</enum>
787781
</property>
788782
<property name="renderHints">
789-
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing</set>
790-
</property>
791-
<property name="dragMode">
792-
<enum>QGraphicsView::NoDrag</enum>
783+
<set>QPainter::Antialiasing</set>
793784
</property>
794785
</widget>
795786
</item>
@@ -811,10 +802,7 @@
811802
<enum>Qt::ScrollBarAlwaysOn</enum>
812803
</property>
813804
<property name="renderHints">
814-
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing</set>
815-
</property>
816-
<property name="dragMode">
817-
<enum>QGraphicsView::NoDrag</enum>
805+
<set>QPainter::Antialiasing</set>
818806
</property>
819807
</widget>
820808
</item>
@@ -831,8 +819,8 @@
831819
<rect>
832820
<x>0</x>
833821
<y>0</y>
834-
<width>353</width>
835-
<height>227</height>
822+
<width>292</width>
823+
<height>202</height>
836824
</rect>
837825
</property>
838826
<layout class="QGridLayout" name="gridLayout_3">
@@ -1084,16 +1072,16 @@
10841072
</layout>
10851073
</widget>
10861074
<customwidgets>
1087-
<customwidget>
1088-
<class>KillerDoubleSpinBox</class>
1089-
<extends>QDoubleSpinBox</extends>
1090-
<header>urh.ui.KillerDoubleSpinBox.h</header>
1091-
</customwidget>
10921075
<customwidget>
10931076
<class>ZoomableGraphicView</class>
10941077
<extends>QGraphicsView</extends>
10951078
<header>urh.ui.views.ZoomableGraphicView.h</header>
10961079
</customwidget>
1080+
<customwidget>
1081+
<class>KillerDoubleSpinBox</class>
1082+
<extends>QDoubleSpinBox</extends>
1083+
<header>urh.ui.KillerDoubleSpinBox.h</header>
1084+
</customwidget>
10971085
<customwidget>
10981086
<class>ZoomAndDropableGraphicView</class>
10991087
<extends>QGraphicsView</extends>

data/ui/send_recv.ui

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ image: url(:/icons/icons/splitter_handle_vertical.svg);
4747
<rect>
4848
<x>0</x>
4949
<y>0</y>
50-
<width>621</width>
51-
<height>1101</height>
50+
<width>658</width>
51+
<height>1111</height>
5252
</rect>
5353
</property>
5454
<layout class="QVBoxLayout" name="verticalLayout_8">
@@ -498,9 +498,6 @@ image: url(:/icons/icons/splitter_handle_vertical.svg);
498498
<property name="renderHints">
499499
<set>QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
500500
</property>
501-
<property name="cacheMode">
502-
<set>QGraphicsView::CacheNone</set>
503-
</property>
504501
<property name="viewportUpdateMode">
505502
<enum>QGraphicsView::MinimalViewportUpdate</enum>
506503
</property>

data/ui/signal_frame.ui

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -897,12 +897,6 @@ stop:1 rgba(255, 255, 255, 0));
897897
<property name="renderHints">
898898
<set>QPainter::Antialiasing|QPainter::TextAntialiasing</set>
899899
</property>
900-
<property name="dragMode">
901-
<enum>QGraphicsView::NoDrag</enum>
902-
</property>
903-
<property name="cacheMode">
904-
<set>QGraphicsView::CacheNone</set>
905-
</property>
906900
<property name="transformationAnchor">
907901
<enum>QGraphicsView::NoAnchor</enum>
908902
</property>
@@ -915,9 +909,6 @@ stop:1 rgba(255, 255, 255, 0));
915909
<property name="rubberBandSelectionMode">
916910
<enum>Qt::ContainsItemShape</enum>
917911
</property>
918-
<property name="optimizationFlags">
919-
<set>QGraphicsView::DontClipPainter|QGraphicsView::DontSavePainterState</set>
920-
</property>
921912
</widget>
922913
</item>
923914
</layout>
@@ -953,18 +944,12 @@ stop:1 rgba(255, 255, 255, 0));
953944
<property name="renderHints">
954945
<set>QPainter::TextAntialiasing</set>
955946
</property>
956-
<property name="cacheMode">
957-
<set>QGraphicsView::CacheNone</set>
958-
</property>
959947
<property name="transformationAnchor">
960948
<enum>QGraphicsView::NoAnchor</enum>
961949
</property>
962950
<property name="viewportUpdateMode">
963951
<enum>QGraphicsView::MinimalViewportUpdate</enum>
964952
</property>
965-
<property name="optimizationFlags">
966-
<set>QGraphicsView::DontClipPainter|QGraphicsView::DontSavePainterState</set>
967-
</property>
968953
</widget>
969954
</item>
970955
</layout>

0 commit comments

Comments
 (0)