mirror of
https://github.com/miek/inspectrum.git
synced 2026-02-19 17:21:37 +01:00
Support Qt6
This commit is contained in:
@@ -52,8 +52,10 @@ list(APPEND inspectrum_sources
|
||||
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 @@ include_directories(
|
||||
|
||||
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")
|
||||
|
||||
|
||||
@@ -91,7 +91,11 @@ void PlotView::updateAnnotationTooltip(QMouseEvent *event)
|
||||
} 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();
|
||||
}
|
||||
@@ -261,7 +265,11 @@ bool PlotView::viewportEvent(QEvent *event) {
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user