mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-10 23:52:59 -04:00
- Switch RDEPEND to dev-qt/qtbase:6 + dev-qt/qtsvg:6.
- Pass -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Core=ON so upstream's Qt5-first
detection takes the Qt6 branch.
- Apply upstream c428bd66 to fix nativeEvent override under Qt6.
- Refresh PYTHON_COMPAT to python3_{12..15}.
Signed-off-by: Huang Rui <vowstar@gmail.com>
124 lines
3.5 KiB
Diff
124 lines
3.5 KiB
Diff
From c428bd66e313aaf64bfe5b96c687858a72fa6ddd Mon Sep 17 00:00:00 2001
|
|
From: dreamsource-tai <tzz@dreamsourcelab.com>
|
|
Date: Thu, 11 Jul 2024 15:14:28 +0800
|
|
Subject: [PATCH] fix: unable to complie with qt6
|
|
|
|
---
|
|
DSView/pv/dock/keywordlineedit.cpp | 16 +++++++++++++++-
|
|
DSView/pv/dock/keywordlineedit.h | 1 +
|
|
DSView/pv/mainframe.cpp | 8 +++-----
|
|
DSView/pv/mainframe.h | 11 +++++++++--
|
|
libsigrok4DSL/lib_main.c | 2 +-
|
|
5 files changed, 29 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/DSView/pv/dock/keywordlineedit.cpp b/DSView/pv/dock/keywordlineedit.cpp
|
|
index a74c8c15..aef003ec 100644
|
|
--- a/DSView/pv/dock/keywordlineedit.cpp
|
|
+++ b/DSView/pv/dock/keywordlineedit.cpp
|
|
@@ -25,6 +25,7 @@
|
|
#include "../config/appconfig.h"
|
|
#include "../ui/langresource.h"
|
|
#include "../log.h"
|
|
+#include "../dsvdef.h"
|
|
|
|
namespace{
|
|
QTimer *move_timer = NULL;
|
|
@@ -120,7 +121,20 @@ void KeyLineEdit::wheelEvent(QWheelEvent *event)
|
|
int v = new_text.toInt();
|
|
int old_v = v;
|
|
|
|
- if (event->delta() > 0){
|
|
+ int delta = 0;
|
|
+
|
|
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
+ int anglex = event->angleDelta().x();
|
|
+ int angley = event->angleDelta().y();
|
|
+
|
|
+ if (anglex == 0 || ABS_VAL(angley) >= ABS_VAL(anglex)){
|
|
+ delta = angley;
|
|
+ }
|
|
+#else
|
|
+ delta = event->delta();
|
|
+#endif
|
|
+
|
|
+ if (delta > 0){
|
|
v++;
|
|
}
|
|
else{
|
|
diff --git a/DSView/pv/dock/keywordlineedit.h b/DSView/pv/dock/keywordlineedit.h
|
|
index 5a32ec51..93b50cb8 100644
|
|
--- a/DSView/pv/dock/keywordlineedit.h
|
|
+++ b/DSView/pv/dock/keywordlineedit.h
|
|
@@ -28,6 +28,7 @@
|
|
#include <QWidget>
|
|
#include <QDialog>
|
|
#include <QSpinBox>
|
|
+#include <QWheelEvent>
|
|
|
|
class IKeywordActive{
|
|
public:
|
|
diff --git a/DSView/pv/mainframe.cpp b/DSView/pv/mainframe.cpp
|
|
index f9e91588..9f92d42b 100644
|
|
--- a/DSView/pv/mainframe.cpp
|
|
+++ b/DSView/pv/mainframe.cpp
|
|
@@ -1106,10 +1106,9 @@ QWidget* MainFrame::GetBodyView()
|
|
return _mainWindow->GetBodyView();
|
|
}
|
|
|
|
-bool MainFrame::nativeEvent(const QByteArray &eventType, void *message, long *result)
|
|
-{
|
|
#ifdef _WIN32
|
|
-
|
|
+bool MainFrame::nativeEvent(const QByteArray &eventType, void *message, MESSAGE_RESULT_PTR result)
|
|
+{
|
|
if (_parentNativeWidget != NULL)
|
|
{
|
|
MSG *msg = static_cast<MSG*>(message);
|
|
@@ -1129,10 +1128,9 @@ bool MainFrame::nativeEvent(const QByteArray &eventType, void *message, long *re
|
|
}
|
|
}
|
|
}
|
|
-
|
|
-#endif
|
|
|
|
return QWidget::nativeEvent(eventType, message, result);
|
|
}
|
|
+#endif
|
|
|
|
} // namespace pv
|
|
diff --git a/DSView/pv/mainframe.h b/DSView/pv/mainframe.h
|
|
index 36674801..0c2ec3ee 100644
|
|
--- a/DSView/pv/mainframe.h
|
|
+++ b/DSView/pv/mainframe.h
|
|
@@ -37,6 +37,13 @@
|
|
|
|
#include "toolbars/titlebar.h"
|
|
|
|
+
|
|
+#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
|
+typedef qintptr *MESSAGE_RESULT_PTR;
|
|
+#else
|
|
+typedef long *MESSAGE_RESULT_PTR;
|
|
+#endif
|
|
+
|
|
namespace pv {
|
|
|
|
class MainWindow;
|
|
@@ -108,14 +115,14 @@ class MainFrame :
|
|
void resizeEvent(QResizeEvent *event);
|
|
void closeEvent(QCloseEvent *event);
|
|
bool eventFilter(QObject *object, QEvent *event) override;
|
|
+
|
|
#ifdef _WIN32
|
|
void showEvent(QShowEvent *event);
|
|
+ bool nativeEvent(const QByteArray &eventType, void *message, MESSAGE_RESULT_PTR result) override;
|
|
#endif
|
|
|
|
void changeEvent(QEvent *event) override;
|
|
|
|
- bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
|
|
-
|
|
signals:
|
|
void sig_ParentNativeEvent(int msg);
|
|
|