File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,8 +52,10 @@ list(APPEND inspectrum_sources
5252 util.cpp
5353)
5454
55- find_package (Qt5Widgets REQUIRED )
56- find_package (Qt5Concurrent REQUIRED )
55+ find_package (Qt6 COMPONENTS Core Concurrent Widgets )
56+ if (NOT Qt6_FOUND)
57+ find_package (Qt5 REQUIRED COMPONENTS Core Concurrent Widgets )
58+ endif ()
5759find_package (FFTW REQUIRED )
5860find_package (Liquid REQUIRED )
5961
@@ -64,11 +66,19 @@ include_directories(
6466
6567add_executable (inspectrum ${EXE_ARGS} ${inspectrum_sources} )
6668
67- target_link_libraries (inspectrum
68- Qt5::Core Qt5::Widgets Qt5::Concurrent
69- ${FFTW_LIBRARIES}
70- ${LIQUID_LIBRARIES}
71- )
69+ if (Qt6_FOUND)
70+ target_link_libraries (inspectrum
71+ Qt6::Core Qt6::Widgets Qt6::Concurrent
72+ ${FFTW_LIBRARIES}
73+ ${LIQUID_LIBRARIES}
74+ )
75+ else ()
76+ target_link_libraries (inspectrum
77+ Qt5::Core Qt5::Widgets Qt5::Concurrent
78+ ${FFTW_LIBRARIES}
79+ ${LIQUID_LIBRARIES}
80+ )
81+ endif ()
7282
7383set (INSTALL_DEFAULT_BINDIR "bin" CACHE STRING "Appended to CMAKE_INSTALL_PREFIX" )
7484
Original file line number Diff line number Diff line change @@ -91,7 +91,11 @@ void PlotView::updateAnnotationTooltip(QMouseEvent *event)
9191 } else {
9292 QString* comment = spectrogramPlot->mouseAnnotationComment (event);
9393 if (comment != nullptr ) {
94+ #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
95+ QToolTip::showText (event->globalPosition ().toPoint (), *comment);
96+ #else
9497 QToolTip::showText (event->globalPos (), *comment);
98+ #endif
9599 } else {
96100 QToolTip::hideText ();
97101 }
@@ -261,7 +265,11 @@ bool PlotView::viewportEvent(QEvent *event) {
261265 for (auto && plot : plots) {
262266 auto mouse_event = QMouseEvent (
263267 event->type (),
268+ #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
264269 QPoint (mouseEvent->position ().x (), mouseEvent->position ().y () - plotY),
270+ #else
271+ QPoint (mouseEvent->pos ().x (), mouseEvent->pos ().y () - plotY),
272+ #endif
265273 mouseEvent->button (),
266274 mouseEvent->buttons (),
267275 QApplication::keyboardModifiers ()
You can’t perform that action at this time.
0 commit comments