Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package inspectrum for openSUSE:Factory 
checked in at 2025-12-08 11:56:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/inspectrum (Old)
 and      /work/SRC/openSUSE:Factory/.inspectrum.new.1939 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "inspectrum"

Mon Dec  8 11:56:11 2025 rev:8 rq:1321463 version:0.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/inspectrum/inspectrum.changes    2023-10-31 
20:26:26.843587681 +0100
+++ /work/SRC/openSUSE:Factory/.inspectrum.new.1939/inspectrum.changes  
2025-12-08 11:56:58.789092774 +0100
@@ -1,0 +2,9 @@
+Sat Dec  6 15:55:46 UTC 2025 - Martin Hauke <[email protected]>
+
+- Update to version 0.4.0
+  * Add support for Qt6.
+  * CMake minimum version changed from 3.1 to 3.5.
+  * Add support for SigMF datasets (#236).
+  * Fix crash when opening small files (#238).
+
+-------------------------------------------------------------------

Old:
----
  inspectrum-0.3.1.tar.gz

New:
----
  inspectrum-0.4.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ inspectrum.spec ++++++
--- /var/tmp/diff_new_pack.uH3gQG/_old  2025-12-08 11:56:59.285113554 +0100
+++ /var/tmp/diff_new_pack.uH3gQG/_new  2025-12-08 11:56:59.285113554 +0100
@@ -1,8 +1,8 @@
 #
 # spec file for package inspectrum
 #
-# Copyright (c) 2023 SUSE LLC
-# Copyright (c) 2015-2023, Martin Hauke <[email protected]>
+# Copyright (c) 2025 SUSE LLC and contributors
+# Copyright (c) 2015-2025, Martin Hauke <[email protected]>
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 
 Name:           inspectrum
-Version:        0.3.1
+Version:        0.4.0
 Release:        0
 Summary:        A tool for analysing captured signals from SDRs
 License:        GPL-3.0-or-later
@@ -28,17 +28,15 @@
 BuildRequires:  boost-devel
 BuildRequires:  cmake
 BuildRequires:  gcc-c++
-BuildRequires:  git-core
 BuildRequires:  libliquid-devel
 BuildRequires:  pkgconfig
-BuildRequires:  pkgconfig(Qt5Concurrent)
-# QCommandLineParser needs QT5.2+
-BuildRequires:  pkgconfig(Qt5Widgets) >= 5.2
+BuildRequires:  pkgconfig(Qt6Concurrent)
+BuildRequires:  pkgconfig(Qt6Widgets)
 BuildRequires:  pkgconfig(fftw3f)
 Requires(post): hicolor-icon-theme
 Requires(post): update-desktop-files
-Requires(postun):hicolor-icon-theme
-Requires(postun):update-desktop-files
+Requires(postun): hicolor-icon-theme
+Requires(postun): update-desktop-files
 
 %description
 A tool for analysing captured signals, primarily from software-defined radio 
receivers

++++++ inspectrum-0.3.1.tar.gz -> inspectrum-0.4.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/.github/workflows/build.yml 
new/inspectrum-0.4.0/.github/workflows/build.yml
--- old/inspectrum-0.3.1/.github/workflows/build.yml    2023-10-22 
22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/.github/workflows/build.yml    2025-12-01 
01:48:41.000000000 +0100
@@ -11,26 +11,40 @@
 env:
   BUILD_TYPE: Release
   # For macOS qt keg-only package
-  CMAKE_PREFIX_PATH: '/usr/local/opt/qt@5'
+  CMAKE_PREFIX_PATH: '/opt/homebrew/opt/qt@5'
 
 jobs:
   build:
     strategy:
+      fail-fast: false
       matrix:
-        os: ['macos-latest', 'ubuntu-22.04', 'ubuntu-20.04']
+        os: ['macos-latest', 'ubuntu-24.04', 'ubuntu-22.04']
+        qt: ['qt5', 'qt6']
     runs-on: ${{ matrix.os }}
 
     steps:
     - uses: actions/checkout@v2
 
+    - name: Set variables Qt5
+      run: |
+        echo "QTPKG_MAC=qt@5" >> $GITHUB_ENV
+        echo "QTPKG_UBUNTU=qtbase5-dev" >> $GITHUB_ENV
+      if: matrix.qt == 'qt5'
+
+    - name: Set variables Qt6
+      run: |
+        echo "QTPKG_MAC=qt@6" >> $GITHUB_ENV
+        echo "QTPKG_UBUNTU=qt6-base-dev" >> $GITHUB_ENV
+      if: matrix.qt == 'qt6'
+
     - name: Install dependencies (macOS)
-      run: brew install fftw liquid-dsp qt@5
+      run: brew install fftw liquid-dsp ${{ env.QTPKG_MAC }}
       if: matrix.os == 'macos-latest'
 
     - name: Install dependencies (Ubuntu)
       run: |
         sudo apt update
-        sudo apt install libfftw3-dev libliquid-dev qtbase5-dev
+        sudo apt install libfftw3-dev libliquid-dev libgl1-mesa-dev ${{ 
env.QTPKG_UBUNTU }}
       if: startsWith(matrix.os, 'ubuntu-')
 
     - name: Create Build Environment
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/CMakeLists.txt 
new/inspectrum-0.4.0/CMakeLists.txt
--- old/inspectrum-0.3.1/CMakeLists.txt 2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/CMakeLists.txt 2025-12-01 01:48:41.000000000 +0100
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.5)
 project(inspectrum CXX)
 enable_testing()
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/README.md 
new/inspectrum-0.4.0/README.md
--- old/inspectrum-0.3.1/README.md      2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/README.md      2025-12-01 01:48:41.000000000 +0100
@@ -3,7 +3,26 @@
 
 ![inspectrum screenshot](/screenshot.jpg)
 
-## Try it
+## Features
+ * Large (100GB+) file support
+ * Spectrogram with zoom/pan
+ * Plots of amplitude, frequency, phase and IQ samples
+ * Cursors for measuring period, symbol rate and extracting symbols
+ * Export of selected time period, filtered samples and demodulated data
+
+## Install
+### Linux
+Install inspectrum with your package manager, it should be present in most 
distros.
+
+### macOS
+ * [Homebrew](https://formulae.brew.sh/formula/inspectrum)
+ * [MacPorts](https://ports.macports.org/port/inspectrum/)
+
+## Windows
+ * [radioconda](https://github.com/ryanvolz/radioconda)
+ * [conda](https://anaconda.org/conda-forge/inspectrum)
+
+## Build from source
 ### Prerequisites
 
  * cmake >= 3.1
@@ -38,13 +57,3 @@
 If an unknown file extension is loaded, inspectrum will default to `*.cf32`.
 
 Note: 64-bit samples will be truncated to 32-bit before processing, as 
inspectrum only supports 32-bit internally.
-
-## Features
- * Large (100GB+) file support
- * Spectrogram with zoom/pan
- * Plots of amplitude, frequency, phase and IQ samples
- * Cursors for measuring period, symbol rate and extracting symbols
- * Export of selected time period, filtered samples and demodulated data
-
-## Contact
- * #inspectrum on [libera.chat](https://libera.chat)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/CMakeLists.txt 
new/inspectrum-0.4.0/src/CMakeLists.txt
--- old/inspectrum-0.3.1/src/CMakeLists.txt     2023-10-22 22:21:10.000000000 
+0200
+++ new/inspectrum-0.4.0/src/CMakeLists.txt     2025-12-01 01:48:41.000000000 
+0100
@@ -52,8 +52,10 @@
     util.cpp
 )
 
-find_package(Qt5Widgets REQUIRED)
-find_package(Qt5Concurrent REQUIRED)
+find_package(Qt6 COMPONENTS Core Concurrent Widgets)
+if (NOT Qt6_FOUND)
+    find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets)
+endif()
 find_package(FFTW REQUIRED)
 find_package(Liquid REQUIRED)
 
@@ -64,11 +66,19 @@
 
 add_executable(inspectrum ${EXE_ARGS} ${inspectrum_sources})
 
-target_link_libraries(inspectrum
-    Qt5::Core Qt5::Widgets Qt5::Concurrent
-    ${FFTW_LIBRARIES}
-    ${LIQUID_LIBRARIES}
-)
+if (Qt6_FOUND)
+    target_link_libraries(inspectrum
+        Qt6::Core Qt6::Widgets Qt6::Concurrent
+        ${FFTW_LIBRARIES}
+        ${LIQUID_LIBRARIES}
+    )
+else()
+    target_link_libraries(inspectrum
+        Qt5::Core Qt5::Widgets Qt5::Concurrent
+        ${FFTW_LIBRARIES}
+        ${LIQUID_LIBRARIES}
+    )
+endif()
 
 set(INSTALL_DEFAULT_BINDIR "bin" CACHE STRING "Appended to 
CMAKE_INSTALL_PREFIX")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/cursor.cpp 
new/inspectrum-0.4.0/src/cursor.cpp
--- old/inspectrum-0.3.1/src/cursor.cpp 2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/src/cursor.cpp 2025-12-01 01:48:41.000000000 +0100
@@ -37,24 +37,24 @@
     return range.contains(fromPoint(point));
 }
 
-bool Cursor::mouseEvent(QEvent::Type type, QMouseEvent event)
+bool Cursor::mouseEvent(QEvent::Type type, QMouseEvent *event)
 {
     // If the mouse pointer moves over a cursor, display a resize pointer
-    if (pointOverCursor(event.pos()) && type != QEvent::Leave) {
-        if (!cursorOverrided) {
-            cursorOverrided = true;
+    if (pointOverCursor(event->pos())) {
+        if (!cursorOverriden) {
+            cursorOverriden = true;
             QApplication::setOverrideCursor(QCursor(cursorShape));
         }
-    // Restore pointer if it moves off the cursor, or leaves the widget
-    } else if (cursorOverrided) {
-        cursorOverrided = false;
+    // Restore pointer if it moves off the cursor
+    } else if (cursorOverriden) {
+        cursorOverriden = false;
         QApplication::restoreOverrideCursor();
     }
 
     // Start dragging on left mouse button press, if over a cursor
     if (type == QEvent::MouseButtonPress) {
-        if (event.button() == Qt::LeftButton) {
-            if (pointOverCursor(event.pos())) {
+        if (event->button() == Qt::LeftButton) {
+            if (pointOverCursor(event->pos())) {
                 dragging = true;
                 return true;
             }
@@ -63,13 +63,13 @@
     // Update current cursor position if we're dragging
     } else if (type == QEvent::MouseMove) {
         if (dragging) {
-            cursorPosition = fromPoint(event.pos());
+            cursorPosition = fromPoint(event->pos());
             emit posChanged();
         }
 
     // Stop dragging on left mouse button release
     } else if (type == QEvent::MouseButtonRelease) {
-        if (event.button() == Qt::LeftButton && dragging) {
+        if (event->button() == Qt::LeftButton && dragging) {
             dragging = false;
             return true;
         }
@@ -77,6 +77,14 @@
     return false;
 }
 
+void Cursor::leaveEvent()
+{
+    if (cursorOverriden) {
+        cursorOverriden = false;
+        QApplication::restoreOverrideCursor();
+    }
+}
+
 int Cursor::pos()
 {
     return cursorPosition;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/cursor.h 
new/inspectrum-0.4.0/src/cursor.h
--- old/inspectrum-0.3.1/src/cursor.h   2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/src/cursor.h   2025-12-01 01:48:41.000000000 +0100
@@ -32,7 +32,8 @@
     Cursor(Qt::Orientation orientation, Qt::CursorShape mouseCursorShape, 
QObject * parent);
     int pos();
     void setPos(int newPos);
-    bool mouseEvent(QEvent::Type type, QMouseEvent event);
+    bool mouseEvent(QEvent::Type type, QMouseEvent *event);
+    void leaveEvent();
 
 signals:
     void posChanged();
@@ -44,6 +45,6 @@
     Qt::Orientation orientation;
     Qt::CursorShape cursorShape;
     bool dragging = false;
-    bool cursorOverrided = false;
+    bool cursorOverriden = false;
     int cursorPosition = 0;
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/cursors.cpp 
new/inspectrum-0.4.0/src/cursors.cpp
--- old/inspectrum-0.3.1/src/cursors.cpp        2023-10-22 22:21:10.000000000 
+0200
+++ new/inspectrum-0.4.0/src/cursors.cpp        2025-12-01 01:48:41.000000000 
+0100
@@ -44,15 +44,15 @@
     return range.contains(point.x());
 }
 
-bool Cursors::mouseEvent(QEvent::Type type, QMouseEvent event)
+bool Cursors::mouseEvent(QEvent::Type type, QMouseEvent *event)
 {
     if (minCursor->mouseEvent(type, event))
         return true;
     if (maxCursor->mouseEvent(type, event))
-    return true;
+        return true;
 
     // If the mouse pointer is between the cursors, display a resize pointer
-    if (pointWithinDragRegion(event.pos()) && type != QEvent::Leave) {
+    if (pointWithinDragRegion(event->pos()) ) {
         if (!cursorOverride) {
                 cursorOverride = true;
                 QApplication::setOverrideCursor(QCursor(Qt::SizeAllCursor));
@@ -66,25 +66,25 @@
     }
     // Start dragging on left mouse button press, if between the cursors
     if (type == QEvent::MouseButtonPress) {
-        if (event.button() == Qt::LeftButton) {
-            if (pointWithinDragRegion(event.pos())) {
+        if (event->button() == Qt::LeftButton) {
+            if (pointWithinDragRegion(event->pos())) {
                 dragging = true;
-                dragPos = event.pos();
+                dragPos = event->pos();
                 return true;
             }
         }
     // Update both cursor positons if we're dragging
     } else if (type == QEvent::MouseMove) {
         if (dragging) {
-            int dx = event.pos().x() - dragPos.x();
+            int dx = event->pos().x() - dragPos.x();
             minCursor->setPos(minCursor->pos() + dx);
             maxCursor->setPos(maxCursor->pos() + dx);
-            dragPos = event.pos();
+            dragPos = event->pos();
             emit cursorsMoved();
         }
     // Stop dragging on left mouse button release
     } else if (type == QEvent::MouseButtonRelease) {
-        if (event.button() == Qt::LeftButton && dragging) {
+        if (event->button() == Qt::LeftButton && dragging) {
             dragging = false;
             return true;
         }
@@ -92,6 +92,17 @@
     return false;
 }
 
+void Cursors::leaveEvent()
+{
+    minCursor->leaveEvent();
+    maxCursor->leaveEvent();
+
+    if (cursorOverride) {
+        cursorOverride = false;
+        QApplication::restoreOverrideCursor();
+    }
+}
+
 void Cursors::paintFront(QPainter &painter, QRect &rect, range_t<size_t> 
sampleRange)
 {
     painter.save();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/cursors.h 
new/inspectrum-0.4.0/src/cursors.h
--- old/inspectrum-0.3.1/src/cursors.h  2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/src/cursors.h  2025-12-01 01:48:41.000000000 +0100
@@ -33,7 +33,8 @@
 public:
     Cursors(QObject * parent);
     int segments();
-    bool mouseEvent(QEvent::Type type, QMouseEvent event);
+    bool mouseEvent(QEvent::Type type, QMouseEvent *event);
+    void leaveEvent();
     void paintFront(QPainter &painter, QRect &rect, range_t<size_t> 
sampleRange);
     range_t<int> selection();
     void setSegments(int segments);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/inputsource.cpp 
new/inspectrum-0.4.0/src/inputsource.cpp
--- old/inspectrum-0.3.1/src/inputsource.cpp    2023-10-22 22:21:10.000000000 
+0200
+++ new/inspectrum-0.4.0/src/inputsource.cpp    2025-12-01 01:48:41.000000000 
+0100
@@ -241,7 +241,7 @@
     }
 }
 
-void InputSource::readMetaData(const QString &filename)
+QJsonObject InputSource::readMetaData(const QString &filename)
 {
     QFile datafile(filename);
     if (!datafile.open(QFile::ReadOnly | QIODevice::Text)) {
@@ -349,6 +349,8 @@
             }
         }
     }
+
+    return root;
 }
 
 void InputSource::openFile(const char *filename)
@@ -406,7 +408,20 @@
     if (suffix == "sigmf-meta" || suffix == "sigmf-data" || suffix == 
"sigmf-") {
         dataFilename = fileInfo.path() + "/" + fileInfo.completeBaseName() + 
".sigmf-data";
         metaFilename = fileInfo.path() + "/" + fileInfo.completeBaseName() + 
".sigmf-meta";
-        readMetaData(metaFilename);
+        auto metaData = readMetaData(metaFilename);
+        QFile datafile(dataFilename);
+        if (!datafile.open(QFile::ReadOnly | QIODevice::Text)) {
+            auto global = metaData["global"].toObject();
+            if (global.contains("core:dataset")) {
+                auto datasetfilename = global["core:dataset"].toString();
+                if(QFileInfo(datasetfilename).isAbsolute()){
+                    dataFilename = datasetfilename;
+                }
+                else{
+                    dataFilename = fileInfo.path() + "/" + datasetfilename;
+                }
+            }
+        }
     }
     else if (suffix == "sigmf") {
         throw std::runtime_error("SigMF archives are not supported. Consider 
extracting a recording.");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/inputsource.h 
new/inspectrum-0.4.0/src/inputsource.h
--- old/inspectrum-0.3.1/src/inputsource.h      2023-10-22 22:21:10.000000000 
+0200
+++ new/inspectrum-0.4.0/src/inputsource.h      2025-12-01 01:48:41.000000000 
+0100
@@ -42,7 +42,7 @@
     std::string _fmt;
     bool _realSignal = false;
 
-    void readMetaData(const QString &filename);
+    QJsonObject readMetaData(const QString &filename);
 
 public:
     InputSource();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/mainwindow.cpp 
new/inspectrum-0.4.0/src/mainwindow.cpp
--- old/inspectrum-0.3.1/src/mainwindow.cpp     2023-10-22 22:21:10.000000000 
+0200
+++ new/inspectrum-0.4.0/src/mainwindow.cpp     2025-12-01 01:48:41.000000000 
+0100
@@ -72,12 +72,13 @@
 
     // Try to parse osmocom_fft filenames and extract the sample rate and 
center frequency.
     // Example file name: 
"name-f2.411200e+09-s5.000000e+06-t20160807180210.cfile"
-    QRegExp rx("(.*)-f(.*)-s(.*)-.*\\.cfile");
+    QRegularExpression 
rx(QRegularExpression::anchoredPattern("(.*)-f(.*)-s(.*)-.*\\.cfile"));
     QString basename = fileName.section('/',-1,-1);
 
-    if (rx.exactMatch(basename)) {
-        QString centerfreq = rx.cap(2);
-        QString samplerate = rx.cap(3);
+    auto match = rx.match(basename);
+    if (match.hasMatch()) {
+        QString centerfreq = match.captured(2);
+        QString samplerate = match.captured(3);
 
         std::stringstream ss(samplerate.toUtf8().constData());
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/plot.cpp 
new/inspectrum-0.4.0/src/plot.cpp
--- old/inspectrum-0.3.1/src/plot.cpp   2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/src/plot.cpp   2025-12-01 01:48:41.000000000 +0100
@@ -34,11 +34,16 @@
 
 }
 
-bool Plot::mouseEvent(QEvent::Type type, QMouseEvent event)
+bool Plot::mouseEvent(QEvent::Type type, QMouseEvent *event)
 {
     return false;
 }
 
+void Plot::leaveEvent()
+{
+
+}
+
 std::shared_ptr<AbstractSampleSource> Plot::output()
 {
     return sampleSource;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/plot.h 
new/inspectrum-0.4.0/src/plot.h
--- old/inspectrum-0.3.1/src/plot.h     2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/src/plot.h     2025-12-01 01:48:41.000000000 +0100
@@ -33,7 +33,8 @@
     Plot(std::shared_ptr<AbstractSampleSource> src);
     ~Plot();
     void invalidateEvent() override;
-    virtual bool mouseEvent(QEvent::Type type, QMouseEvent event);
+    virtual bool mouseEvent(QEvent::Type type, QMouseEvent *event);
+    virtual void leaveEvent();
     virtual std::shared_ptr<AbstractSampleSource> output();
     virtual void paintBack(QPainter &painter, QRect &rect, range_t<size_t> 
sampleRange);
     virtual void paintMid(QPainter &painter, QRect &rect, range_t<size_t> 
sampleRange);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/plotview.cpp 
new/inspectrum-0.4.0/src/plotview.cpp
--- old/inspectrum-0.3.1/src/plotview.cpp       2023-10-22 22:21:10.000000000 
+0200
+++ new/inspectrum-0.4.0/src/plotview.cpp       2025-12-01 01:48:41.000000000 
+0100
@@ -91,7 +91,11 @@
     } else {
         QString* comment = spectrogramPlot->mouseAnnotationComment(event);
         if (comment != nullptr) {
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+            QToolTip::showText(event->globalPosition().toPoint(), *comment);
+#else
             QToolTip::showText(event->globalPos(), *comment);
+#endif
         } else {
             QToolTip::hideText();
         }
@@ -253,22 +257,26 @@
     // Pass mouse events to individual plot objects
     if (event->type() == QEvent::MouseButtonPress ||
         event->type() == QEvent::MouseMove ||
-        event->type() == QEvent::MouseButtonRelease ||
-        event->type() == QEvent::Leave) {
+        event->type() == QEvent::MouseButtonRelease) {
 
         QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
 
         int plotY = -verticalScrollBar()->value();
         for (auto&& plot : plots) {
+            auto mouse_event = QMouseEvent(
+                event->type(),
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+                QPoint(mouseEvent->position().x(), mouseEvent->position().y() 
- plotY),
+#else
+                QPoint(mouseEvent->pos().x(), mouseEvent->pos().y() - plotY),
+#endif
+                mouseEvent->button(),
+                mouseEvent->buttons(),
+                QApplication::keyboardModifiers()
+            );
             bool result = plot->mouseEvent(
                 event->type(),
-                QMouseEvent(
-                    event->type(),
-                    QPoint(mouseEvent->pos().x(), mouseEvent->pos().y() - 
plotY),
-                    mouseEvent->button(),
-                    mouseEvent->buttons(),
-                    QApplication::keyboardModifiers()
-                )
+                &mouse_event
             );
             if (result)
                 return true;
@@ -276,10 +284,19 @@
         }
 
         if (cursorsEnabled)
-            if (cursors.mouseEvent(event->type(), *mouseEvent))
+            if (cursors.mouseEvent(event->type(), mouseEvent))
                 return true;
     }
 
+    if (event->type() == QEvent::Leave) {
+        for (auto&& plot : plots) {
+            plot->leaveEvent();
+        }
+
+        if (cursorsEnabled)
+            cursors.leaveEvent();
+    }
+
     // Handle parent eveents
     return QGraphicsView::viewportEvent(event);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/spectrogramplot.cpp 
new/inspectrum-0.4.0/src/spectrogramplot.cpp
--- old/inspectrum-0.3.1/src/spectrogramplot.cpp        2023-10-22 
22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/src/spectrogramplot.cpp        2025-12-01 
01:48:41.000000000 +0100
@@ -351,7 +351,7 @@
     return tileSize / fftSize;
 }
 
-bool SpectrogramPlot::mouseEvent(QEvent::Type type, QMouseEvent event)
+bool SpectrogramPlot::mouseEvent(QEvent::Type type, QMouseEvent *event)
 {
     if (tunerEnabled())
         return tuner.mouseEvent(type, event);
@@ -359,6 +359,12 @@
     return false;
 }
 
+void SpectrogramPlot::leaveEvent()
+{
+    if (tunerEnabled())
+        tuner.leaveEvent();
+}
+
 std::shared_ptr<AbstractSampleSource> SpectrogramPlot::output()
 {
     return tunerTransform;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/spectrogramplot.h 
new/inspectrum-0.4.0/src/spectrogramplot.h
--- old/inspectrum-0.3.1/src/spectrogramplot.h  2023-10-22 22:21:10.000000000 
+0200
+++ new/inspectrum-0.4.0/src/spectrogramplot.h  2025-12-01 01:48:41.000000000 
+0100
@@ -33,9 +33,30 @@
 #include <math.h>
 #include <vector>
 
-class TileCacheKey;
 class AnnotationLocation;
 
+
+class TileCacheKey
+{
+
+public:
+    TileCacheKey(int fftSize, int zoomLevel, size_t sample) {
+        this->fftSize = fftSize;
+        this->zoomLevel = zoomLevel;
+        this->sample = sample;
+    }
+
+    bool operator==(const TileCacheKey &k2) const {
+        return (this->fftSize == k2.fftSize) &&
+               (this->zoomLevel == k2.zoomLevel) &&
+               (this->sample == k2.sample);
+    }
+
+    int fftSize;
+    int zoomLevel;
+    size_t sample;
+};
+
 class SpectrogramPlot : public Plot
 {
     Q_OBJECT
@@ -46,7 +67,8 @@
     std::shared_ptr<AbstractSampleSource> output() override;
     void paintFront(QPainter &painter, QRect &rect, range_t<size_t> 
sampleRange) override;
     void paintMid(QPainter &painter, QRect &rect, range_t<size_t> sampleRange) 
override;
-    bool mouseEvent(QEvent::Type type, QMouseEvent event) override;
+    bool mouseEvent(QEvent::Type type, QMouseEvent *event) override;
+    void leaveEvent();
     std::shared_ptr<SampleSource<std::complex<float>>> input() { return 
inputSource; };
     void setSampleRate(double sampleRate);
     bool tunerEnabled();
@@ -96,27 +118,6 @@
     void paintAnnotations(QPainter &painter, QRect &rect, range_t<size_t> 
sampleRange);
 };
 
-class TileCacheKey
-{
-
-public:
-    TileCacheKey(int fftSize, int zoomLevel, size_t sample) {
-        this->fftSize = fftSize;
-        this->zoomLevel = zoomLevel;
-        this->sample = sample;
-    }
-
-    bool operator==(const TileCacheKey &k2) const {
-        return (this->fftSize == k2.fftSize) &&
-               (this->zoomLevel == k2.zoomLevel) &&
-               (this->sample == k2.sample);
-    }
-
-    int fftSize;
-    int zoomLevel;
-    size_t sample;
-};
-
 class AnnotationLocation
 {
 public:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/traceplot.cpp 
new/inspectrum-0.4.0/src/traceplot.cpp
--- old/inspectrum-0.3.1/src/traceplot.cpp      2023-10-22 22:21:10.000000000 
+0200
+++ new/inspectrum-0.4.0/src/traceplot.cpp      2025-12-01 01:48:41.000000000 
+0100
@@ -32,7 +32,7 @@
 {
     if (sampleRange.length() == 0) return;
 
-    int samplesPerColumn = sampleRange.length() / rect.width();
+    int samplesPerColumn = std::max(1UL, sampleRange.length() / rect.width());
     int samplesPerTile = tileWidth * samplesPerColumn;
     size_t tileID = sampleRange.minimum / samplesPerTile;
     size_t tileOffset = sampleRange.minimum % samplesPerTile; // Number of 
samples to skip from first image tile
@@ -64,7 +64,11 @@
 
     if (!tasks.contains(key)) {
         range_t<size_t> sampleRange{tileID * sampleCount, (tileID + 1) * 
sampleCount};
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+        QtConcurrent::run(&TracePlot::drawTile, this, key, QRect(0, 0, 
tileWidth, height()), sampleRange);
+#else
         QtConcurrent::run(this, &TracePlot::drawTile, key, QRect(0, 0, 
tileWidth, height()), sampleRange);
+#endif
         tasks.insert(key);
     }
     pixmap.fill(Qt::transparent);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/tuner.cpp 
new/inspectrum-0.4.0/src/tuner.cpp
--- old/inspectrum-0.3.1/src/tuner.cpp  2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/src/tuner.cpp  2025-12-01 01:48:41.000000000 +0100
@@ -63,7 +63,7 @@
     return _deviation;
 }
 
-bool Tuner::mouseEvent(QEvent::Type type, QMouseEvent event)
+bool Tuner::mouseEvent(QEvent::Type type, QMouseEvent *event)
 {
     if (cfCursor->mouseEvent(type, event))
         return true;
@@ -75,6 +75,13 @@
     return false;
 }
 
+void Tuner::leaveEvent()
+{
+    cfCursor->leaveEvent();
+    minCursor->leaveEvent();
+    maxCursor->leaveEvent();
+}
+
 void Tuner::paintFront(QPainter &painter, QRect &rect, range_t<size_t> 
sampleRange)
 {
     painter.save();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inspectrum-0.3.1/src/tuner.h 
new/inspectrum-0.4.0/src/tuner.h
--- old/inspectrum-0.3.1/src/tuner.h    2023-10-22 22:21:10.000000000 +0200
+++ new/inspectrum-0.4.0/src/tuner.h    2025-12-01 01:48:41.000000000 +0100
@@ -34,7 +34,8 @@
     Tuner(int height, QObject * parent);
     int centre();
     int deviation();
-    bool mouseEvent(QEvent::Type, QMouseEvent event);
+    bool mouseEvent(QEvent::Type, QMouseEvent *event);
+    void leaveEvent();
     void paintFront(QPainter &painter, QRect &rect, range_t<size_t> 
sampleRange);
     void setCentre(int centre);
     void setDeviation(int dev);

Reply via email to