Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to PyQt6 #1072

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4bb1ef2
road to pyqt6
jopohl Oct 25, 2023
e794218
revert
jopohl Oct 25, 2023
23aa18a
basic working version
jopohl Oct 25, 2023
ce601a8
bring back icons
jopohl Oct 25, 2023
ab959c8
icon fix
jopohl Oct 25, 2023
2c3cb8a
fix exec_ calls
jopohl Oct 25, 2023
c3ca14e
fix exact match
jopohl Oct 25, 2023
aa25b49
more fixes
jopohl Oct 25, 2023
f9b0bc0
more fixes
jopohl Oct 25, 2023
dd7cd41
more fixes
jopohl Oct 25, 2023
4992122
QMessagebox fixes
jopohl Oct 26, 2023
4489740
fix signal frame resizing
jopohl Oct 26, 2023
54c1b88
remove comment
jopohl Oct 26, 2023
183bded
fix docker image
jopohl Oct 26, 2023
9a726cc
switch to manylinux2_28
jopohl Oct 26, 2023
50bc1a3
try older bladerf
jopohl Oct 26, 2023
df82bab
set apiversion directly
jopohl Oct 26, 2023
ad6eb8d
install blas
jopohl Oct 26, 2023
e307ff9
install blas
jopohl Oct 26, 2023
0a2fe69
set library path
jopohl Oct 26, 2023
c020f8b
install missing lib
jopohl Oct 26, 2023
8591e46
add more libs
jopohl Oct 26, 2023
e878e6a
replace qApp in test
jopohl Oct 26, 2023
7e69e1e
replace remaining
jopohl Oct 26, 2023
77e2e50
fix tests
jopohl Oct 27, 2023
02ef353
more fixes
jopohl Oct 27, 2023
6f9c68a
more fixes
jopohl Oct 27, 2023
c47f7d0
Fix check states
jopohl Oct 27, 2023
92d40f5
add future import
jopohl Oct 27, 2023
c87265a
update CI
jopohl Oct 27, 2023
042189c
use python 3.11 on windows
jopohl Oct 27, 2023
00686fc
fix alignment flag
jopohl Oct 27, 2023
5311f42
fix color role
jopohl Oct 27, 2023
c339a89
fix font metrics width
jopohl Oct 27, 2023
1372a56
try python 3.8 on win
jopohl Oct 27, 2023
c97f375
revert CI
jopohl Oct 27, 2023
db8c47a
Fix assignment to const error
andynoack Oct 28, 2023
c997087
fix no module named urh
andynoack Oct 28, 2023
5f2ba96
remove border around tab widget
jopohl Oct 28, 2023
e42d0cb
Revert "remove border around tab widget"
jopohl Oct 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ jobs:
os: [ubuntu-latest, windows-2019, macos-11]
python-version: ['3.7', '3.8', '3.9', '3.10']
architecture: [x64]
include:
- os: windows-2019
python-version: '3.7'
architecture: x86
exclude:
- os: windows-2019
python-version: '3.8'
Expand Down Expand Up @@ -65,7 +61,7 @@ jobs:
if [[ $OS == ubuntu* ]]
then
sudo apt-get update
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
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
pip install PyVirtualDisplay==0.2.5
elif [[ $OS == windows* ]]
then
Expand Down Expand Up @@ -105,12 +101,12 @@ jobs:
- run: python setup.py bdist_wheel
if: ${{ !startsWith(matrix.os, 'ubuntu') }}

- name: Build manylinux2014
- name: Build manylinux wheels
if: startsWith(matrix.os, 'ubuntu')
run: |
docker run --rm \
-e PYVER=$(python -c "import sys; print('%s%s' % (sys.version_info.major, sys.version_info.minor))") \
-v `pwd`:/io jopohl/urh_manylinux2014 /io/data/make_manylinux2014_wheels.sh
-v `pwd`:/io jopohl/urh_manylinux2_28 /io/data/make_manylinux_wheels.sh

- name: Check wheel
if: startsWith(matrix.os, 'ubuntu')
Expand Down
7 changes: 3 additions & 4 deletions data/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:23.04

LABEL maintainer="[email protected]"

Expand All @@ -10,13 +10,12 @@ ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get -qq update \
&& apt-get -qq install software-properties-common \
&& add-apt-repository -y ppa:myriadrf/drivers && apt-get -qq update \
&& apt-get -qq update \
&& apt-get -qq install wget gcc g++ git \
python3 python3-pip python3-pyaudio python3-pyqt5 python3-numpy python3-psutil \
python3 cython3 python3-pip python3-pyaudio python3-pyqt6 python3-numpy python3-psutil python3-setuptools \
fonts-dejavu-core libgles2-mesa libusb-1.0-0 \
gr-osmosdr \
libhackrf-dev liblimesuite-dev libbladerf-dev librtlsdr-dev libairspy-dev libuhd-dev libiio-dev \
&& python3 -m pip install setuptools cython \
&& mkdir /tmp/sdrplay \
&& wget http://www.sdrplay.com/software/SDRplay_RSP_API-Linux-2.13.1.run -O /tmp/sdrplay/sdrplay.run \
&& cd /tmp/sdrplay && bash sdrplay.run --tar xf \
Expand Down
5 changes: 4 additions & 1 deletion data/build_icons.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Build Qt Resource File from custom Icon Theme for Windows
import fileinput
import os

import shutil
Expand Down Expand Up @@ -77,7 +78,9 @@ def copy_icons(icon_names: set):

tree = ET.ElementTree(root)
tree.write("/tmp/xtra_icons.qrc")
call(["pyrcc5", "/tmp/xtra_icons.qrc", "-o", "/tmp/xtra_icons_rc.py"])
call(["pyside6-rcc", "-g", "python", "/tmp/xtra_icons.qrc", "-o", "/tmp/xtra_icons_rc.py"])
for line in fileinput.input("/tmp/xtra_icons_rc.py", inplace=True):
print(line.replace("from PySide6 import QtCore", "from PyQt6 import QtCore"), end="")
tar_path = os.path.dirname(os.path.join(os.path.dirname(__file__), "..", ".."))
tar_path = os.path.join(tar_path, "src/urh/ui")
shutil.copy("/tmp/xtra_icons_rc.py", tar_path)
Expand Down
19 changes: 11 additions & 8 deletions data/generate_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

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

if sys.platform == "win32":
uic_path = os.path.join(bindir, "pyuic5.bat")
rcc_path = os.path.join(bindir, "pyrcc5.exe")
uic_path = os.path.join(bindir, "pyuic6.bat")
rcc_path = os.path.join(bindir, "pyside6-rcc.exe")
else:
uic_path = os.path.join(bindir, "pyuic5")
rcc_path = os.path.join(bindir, "pyrcc5")
uic_path = os.path.join(bindir, "pyuic6")
rcc_path = os.path.join(bindir, "pyside6-rcc")

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

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

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

if time_generated_file < time_rc_file or force:
# Only create, when generated file is old than rc file to prevent unneeded git pushes
call([rcc_path, file_path, "-o", out_file_path])
print(file_path)
# Only create, when generated file is older than rc file to prevent unneeded git pushes
call([rcc_path, "-g", "python", file_path, "-o", out_file_path])
for line in fileinput.input(out_file_path, inplace=True):
print(line.replace("from PySide6 import QtCore", "from PyQt6 import QtCore"), end="")


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

# for adapted jopohl/urh_manylinux
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/:/usr/local/lib/:/usr/lib64/


touch /tmp/urh_releasing
for PYBIN in /opt/python/*$PYVER*/bin; do # for all if PYVER not set
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# for plain quay.io/pypa/manylinux2014_x86_64
# for plain manylinux image

AIRSPY_VERSION="1.0.9"
BLADERF_VERSION="2018.08"
Expand Down
29 changes: 17 additions & 12 deletions data/manylinux2014.Dockerfile → data/manylinux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
FROM quay.io/pypa/manylinux2014_x86_64
FROM quay.io/pypa/manylinux_2_28_x86_64

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
RUN export AIRSPY_VERSION="1.0.9" \
&& export BLADERF_VERSION="2018.08" \
&& export BLADERF_VERSION="2022.11" \
&& export LIMESUITE_VERSION="20.01.0" \
&& export HACKRF_VERSION="v2023.01.1" \
&& export SDRPLAY_VERSION="2.13" \
&& export RTLSDR_VERSION="0.6.0" \
&& export UHD_VERSION="3.15.0.0" \
&& yum -y install wget cmake3 hackrf-devel boost169-devel https://github.com/analogdevicesinc/libiio/releases/download/v0.19/libiio-0.19.g5f5af2e-centos-7-x86_64.rpm \
&& export UHD_VERSION="4.5.0.0" \
# HackRF
&& git clone --branch $HACKRF_VERSION --depth 1 https://github.com/greatscottgadgets/hackrf /tmp/hackrf-$HACKRF_VERSION \
&& cmake3 -Wno-dev -S /tmp/hackrf-$HACKRF_VERSION/host -B /tmp/build_hackrf \
&& make -j$(nproc) -C /tmp/build_hackrf \
&& make -C /tmp/build_hackrf install \
# UHD
&& wget https://github.com/EttusResearch/uhd/archive/v$UHD_VERSION.tar.gz -O /tmp/uhd.tar.gz \
&& tar xf /tmp/uhd.tar.gz -C /tmp \
&& python3.9 -m pip install mako \
&& cmake3 -DBOOST_INCLUDEDIR=/usr/include/boost169/ -DBOOST_LIBRARYDIR=/usr/lib64/boost169/ -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 \
&& python3.10 -m pip install mako \
&& 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 \
&& make -j$(nproc) -C /tmp/build_uhd \
&& make -C /tmp/build_uhd install \
# AirSpy
Expand All @@ -21,21 +27,20 @@ RUN export AIRSPY_VERSION="1.0.9" \
&& make -j$(nproc) -C /tmp/build_airspy \
&& make -C /tmp/build_airspy install \
# BladeRF
&& wget https://github.com/Nuand/bladeRF/archive/$BLADERF_VERSION.tar.gz -O /tmp/bladeRF.tar.gz \
&& tar xf /tmp/bladeRF.tar.gz -C /tmp \
&& cmake3 -Wno-dev -S /tmp/bladeRF-$BLADERF_VERSION/host -B /tmp/build_blade \
&& git clone --branch $BLADERF_VERSION --recursive https://github.com/Nuand/bladeRF /tmp/bladeRF-$BLADERF_VERSION \
&& cmake -S /tmp/bladeRF-$BLADERF_VERSION/host -B /tmp/build_blade \
&& make -j$(nproc) -C /tmp/build_blade \
&& make -C /tmp/build_blade install \
&& wget https://github.com/myriadrf/LimeSuite/archive/v$LIMESUITE_VERSION.tar.gz -O /tmp/lime.tar.gz \
# Lime
&& wget https://github.com/myriadrf/LimeSuite/archive/v$LIMESUITE_VERSION.tar.gz -O /tmp/lime.tar.gz \
&& tar xf /tmp/lime.tar.gz -C /tmp \
&& cmake3 -S /tmp/LimeSuite-$LIMESUITE_VERSION -B /tmp/build_lime \
&& cmake -S /tmp/LimeSuite-$LIMESUITE_VERSION -B /tmp/build_lime \
&& make -j$(nproc) -C /tmp/build_lime \
&& make -C /tmp/build_lime install \
# RTLSDR
&& wget https://github.com/osmocom/rtl-sdr/archive/$RTLSDR_VERSION.tar.gz -O /tmp/rtlsdr.tar.gz \
&& tar xf /tmp/rtlsdr.tar.gz -C /tmp \
&& cmake3 -DDETACH_KERNEL_DRIVER=ON -S /tmp/rtl-sdr-$RTLSDR_VERSION -B /tmp/build_rtlsdr \
&& cmake -DDETACH_KERNEL_DRIVER=ON -S /tmp/rtl-sdr-$RTLSDR_VERSION -B /tmp/build_rtlsdr \
&& make -j$(nproc) -C /tmp/build_rtlsdr \
&& make -C /tmp/build_rtlsdr install \
# SDRPLAY
Expand Down
2 changes: 1 addition & 1 deletion data/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy
pyqt5
PyQt6
psutil
cython<3.0.0
2 changes: 1 addition & 1 deletion data/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ parts:
- libpulse-mainloop-glib0
- libspeechd2
- python3
- python3-pyqt5
- python3-pyqt6
- python3-pyaudio
- dbus
- qtwayland5
Expand Down
48 changes: 18 additions & 30 deletions data/ui/modulation.ui
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<x>0</x>
<y>0</y>
<width>965</width>
<height>984</height>
<height>989</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_7" rowstretch="0,1,0,1,0,1,0,0,1,0,0" columnstretch="0,0,0,0">
Expand Down Expand Up @@ -220,10 +220,7 @@
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="renderHints">
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing</set>
</property>
<property name="dragMode">
<enum>QGraphicsView::NoDrag</enum>
<set>QPainter::Antialiasing</set>
</property>
</widget>
</item>
Expand All @@ -240,8 +237,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>373</width>
<height>330</height>
<width>313</width>
<height>316</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
Expand Down Expand Up @@ -485,8 +482,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>373</width>
<height>141</height>
<width>313</width>
<height>149</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
Expand Down Expand Up @@ -594,8 +591,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>353</width>
<height>143</height>
<width>313</width>
<height>148</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
Expand Down Expand Up @@ -748,10 +745,7 @@
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="renderHints">
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing</set>
</property>
<property name="dragMode">
<enum>QGraphicsView::NoDrag</enum>
<set>QPainter::Antialiasing</set>
</property>
</widget>
</item>
Expand Down Expand Up @@ -786,10 +780,7 @@
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="renderHints">
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing</set>
</property>
<property name="dragMode">
<enum>QGraphicsView::NoDrag</enum>
<set>QPainter::Antialiasing</set>
</property>
</widget>
</item>
Expand All @@ -811,10 +802,7 @@
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="renderHints">
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing</set>
</property>
<property name="dragMode">
<enum>QGraphicsView::NoDrag</enum>
<set>QPainter::Antialiasing</set>
</property>
</widget>
</item>
Expand All @@ -831,8 +819,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>353</width>
<height>227</height>
<width>292</width>
<height>202</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
Expand Down Expand Up @@ -1084,16 +1072,16 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KillerDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>urh.ui.KillerDoubleSpinBox.h</header>
</customwidget>
<customwidget>
<class>ZoomableGraphicView</class>
<extends>QGraphicsView</extends>
<header>urh.ui.views.ZoomableGraphicView.h</header>
</customwidget>
<customwidget>
<class>KillerDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>urh.ui.KillerDoubleSpinBox.h</header>
</customwidget>
<customwidget>
<class>ZoomAndDropableGraphicView</class>
<extends>QGraphicsView</extends>
Expand Down
7 changes: 2 additions & 5 deletions data/ui/send_recv.ui
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ image: url(:/icons/icons/splitter_handle_vertical.svg);
<rect>
<x>0</x>
<y>0</y>
<width>621</width>
<height>1101</height>
<width>658</width>
<height>1111</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
Expand Down Expand Up @@ -498,9 +498,6 @@ image: url(:/icons/icons/splitter_handle_vertical.svg);
<property name="renderHints">
<set>QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
</property>
<property name="cacheMode">
<set>QGraphicsView::CacheNone</set>
</property>
<property name="viewportUpdateMode">
<enum>QGraphicsView::MinimalViewportUpdate</enum>
</property>
Expand Down
15 changes: 0 additions & 15 deletions data/ui/signal_frame.ui
Original file line number Diff line number Diff line change
Expand Up @@ -897,12 +897,6 @@ stop:1 rgba(255, 255, 255, 0));
<property name="renderHints">
<set>QPainter::Antialiasing|QPainter::TextAntialiasing</set>
</property>
<property name="dragMode">
<enum>QGraphicsView::NoDrag</enum>
</property>
<property name="cacheMode">
<set>QGraphicsView::CacheNone</set>
</property>
<property name="transformationAnchor">
<enum>QGraphicsView::NoAnchor</enum>
</property>
Expand All @@ -915,9 +909,6 @@ stop:1 rgba(255, 255, 255, 0));
<property name="rubberBandSelectionMode">
<enum>Qt::ContainsItemShape</enum>
</property>
<property name="optimizationFlags">
<set>QGraphicsView::DontClipPainter|QGraphicsView::DontSavePainterState</set>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -953,18 +944,12 @@ stop:1 rgba(255, 255, 255, 0));
<property name="renderHints">
<set>QPainter::TextAntialiasing</set>
</property>
<property name="cacheMode">
<set>QGraphicsView::CacheNone</set>
</property>
<property name="transformationAnchor">
<enum>QGraphicsView::NoAnchor</enum>
</property>
<property name="viewportUpdateMode">
<enum>QGraphicsView::MinimalViewportUpdate</enum>
</property>
<property name="optimizationFlags">
<set>QGraphicsView::DontClipPainter|QGraphicsView::DontSavePainterState</set>
</property>
</widget>
</item>
</layout>
Expand Down
Loading