From 120899e9f8d9f2d69bd835982ccfcade42c61755 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 15 Jan 2023 10:34:54 +0000 Subject: [PATCH] Various fixes to allow Qt6 compiling on mac --- loggingwindow.cpp | 5 ++++- qledlabel.cpp | 2 +- resampler/resample.c | 6 +++--- resampler/resample_sse.h | 4 ++-- wfview.pro | 28 +++++++++++++++------------- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/loggingwindow.cpp b/loggingwindow.cpp index e3667df..6282650 100644 --- a/loggingwindow.cpp +++ b/loggingwindow.cpp @@ -27,8 +27,11 @@ loggingWindow::loggingWindow(QString logFilename, QWidget *parent) : connect(socket, SIGNAL(connected()), this, SLOT(connectedToHost())); connect(socket, SIGNAL(disconnected()), this, SLOT(disconnectedFromHost())); connect(socket, SIGNAL(readyRead()), this, SLOT(handleDataFromLoggingHost())); +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(handleLoggingHostError(QAbstractSocket::SocketError))); +#else connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(handleLoggingHostError(QAbstractSocket::SocketError))); - +#endif vertLogScroll = ui->logTextDisplay->verticalScrollBar(); horizLogScroll = ui->logTextDisplay->horizontalScrollBar(); diff --git a/qledlabel.cpp b/qledlabel.cpp index 4911dde..d4fb314 100644 --- a/qledlabel.cpp +++ b/qledlabel.cpp @@ -19,7 +19,7 @@ QLedLabel::QLedLabel(QWidget* parent) : void QLedLabel::setState(State state) { - qDebug() << "LED: setState" << state; + //Debug() << "LED: setState" << state; switch (state) { case StateOk: setStyleSheet(greenSS); diff --git a/resampler/resample.c b/resampler/resample.c index 99a91d2..aa96cd4 100644 --- a/resampler/resample.c +++ b/resampler/resample.c @@ -96,11 +96,11 @@ static void speex_free(void* ptr) { free(ptr); } #define UINT32_MAX 4294967295U #endif -#ifdef USE_SSE +#if defined(USE_SSE) && !defined(__aarch64__) #include "resample_sse.h" #endif -#ifdef USE_NEON +#if defined(USE_NEON) || defined(__aarch64__) #include "resample_neon.h" #endif @@ -1246,4 +1246,4 @@ EXPORT const char* speex_resampler_strerror(int err) default: return "Unknown error. Bad error code or strange version mismatch."; } -} \ No newline at end of file +} diff --git a/resampler/resample_sse.h b/resampler/resample_sse.h index feda8ff..f3abe3e 100644 --- a/resampler/resample_sse.h +++ b/resampler/resample_sse.h @@ -71,7 +71,7 @@ static inline float interpolate_product_single(const float* a, const float* b, u return ret; } -#ifdef USE_SSE2 +#if defined(USE_SSE2) && !defined(__aarch64__) #include #define OVERRIDE_INNER_PRODUCT_DOUBLE @@ -125,4 +125,4 @@ static inline double interpolate_product_double(const float* a, const float* b, return ret; } -#endif \ No newline at end of file +#endif diff --git a/wfview.pro b/wfview.pro index b041382..d1fe38c 100644 --- a/wfview.pro +++ b/wfview.pro @@ -10,7 +10,7 @@ QT += core gui serialport network multimedia xml #DEFINES += USESQL #Uncomment The following line to enable USB controllers (Shuttle/RC-28 etc.) -#DEFINES += USB_CONTROLLER +DEFINES += USB_CONTROLLER greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport @@ -87,16 +87,18 @@ isEmpty(PREFIX) { DEFINES += PREFIX=\\\"$$PREFIX\\\" macx:INCLUDEPATH += /usr/local/include /opt/local/include -macx:LIBS += -L/usr/local/lib -L/opt/local/lib -L../qcustomplot +macx:LIBS += -L/usr/local/lib -L/opt/local/lib macx:ICON = ../wfview/resources/wfview.icns win32:RC_ICONS = ../wfview/resources/wfview.ico -QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13 +macx:QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14 +macx:QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 +macx:MY_ENTITLEMENTS.name = CODE_SIGN_ENTITLEMENTS +macx:MY_ENTITLEMENTS.value = ../wfview/resources/wfview.entitlements +macx:QMAKE_MAC_XCODE_SETTINGS += MY_ENTITLEMENTS +macx:QMAKE_INFO_PLIST = ../wfview/resources/Info.plist + QMAKE_TARGET_BUNDLE_PREFIX = org.wfview -MY_ENTITLEMENTS.name = CODE_SIGN_ENTITLEMENTS -MY_ENTITLEMENTS.value = ../wfview/resources/wfview.entitlements -QMAKE_MAC_XCODE_SETTINGS += MY_ENTITLEMENTS -QMAKE_INFO_PLIST = ../wfview/resources/Info.plist !win32:DEFINES += HOST=\\\"`hostname`\\\" UNAME=\\\"`whoami`\\\" @@ -136,7 +138,7 @@ macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread -lopus # CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT CONFIG(debug, release|debug) { - linux: QCPLIB = qcustomplotd + !win32: QCPLIB = qcustomplotd win32: QCPLIB = qcustomplotd2 win32 { contains(QMAKE_TARGET.arch, x86_64) { @@ -154,7 +156,7 @@ CONFIG(debug, release|debug) { } } } else { - linux: QCPLIB = qcustomplot + !win32: QCPLIB = qcustomplot win32: QCPLIB = qcustomplot2 win32 { contains(QMAKE_TARGET.arch, x86_64) { @@ -173,7 +175,7 @@ CONFIG(debug, release|debug) { } } -linux:LIBS += -L./ -l$$QCPLIB -lopus +!win32:LIBS += -L./ -l$$QCPLIB -lopus win32:LIBS += -l$$QCPLIB -lopus contains(DEFINES,USB_CONTROLLER){ @@ -183,10 +185,10 @@ contains(DEFINES,USB_CONTROLLER){ win32:SOURCES += ../hidapi/windows/hid.c } -macx:SOURCES += ../qcustomplot/qcustomplot.cpp -macx:HEADERS += ../qcustomplot/qcustomplot.h +#macx:SOURCES += ../qcustomplot/qcustomplot.cpp +#macx:HEADERS += ../qcustomplot/qcustomplot.h -!linux:INCLUDEPATH += ../qcustomplot +win32:INCLUDEPATH += ../qcustomplot !linux:INCLUDEPATH += ../opus/include !linux:INCLUDEPATH += ../eigen