Skip to content

Instantly share code, notes, and snippets.

@shtirlic
Created April 28, 2026 09:10
Show Gist options
  • Select an option

  • Save shtirlic/a0650f345e2b25a5fab0a99bad5318e5 to your computer and use it in GitHub Desktop.

Select an option

Save shtirlic/a0650f345e2b25a5fab0a99bad5318e5 to your computer and use it in GitHub Desktop.
diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt
index c31fbbd..e458cfa 100644
--- a/qt/CMakeLists.txt
+++ b/qt/CMakeLists.txt
@@ -4,11 +4,14 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
-# Platform-specific Qt5 path hints
+# Platform-specific Qt6 path hints
if(APPLE)
- set(Qt5_DIR "/opt/homebrew/opt/qt@5/lib/cmake/Qt5")
+ set(Qt6_DIR "/opt/homebrew/opt/qt@6/lib/cmake/Qt6")
endif()
-find_package(Qt5 5.15 REQUIRED COMPONENTS Core Gui Widgets Quick QuickControls2 Qml)
+find_package(Qt6 6.2 REQUIRED COMPONENTS Core Gui Widgets Quick QuickControls2 Qml)
+
+# Qt6 requires this for QML module support
+qt_standard_project_setup()
set(DSPI_CORE_DIR "${CMAKE_SOURCE_DIR}/..")
@@ -26,7 +29,7 @@ target_include_directories(DSPiConsole PRIVATE
)
target_link_libraries(DSPiConsole PRIVATE
- Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Quick Qt5::QuickControls2 Qt5::Qml
+ Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Quick Qt6::QuickControls2 Qt6::Qml
${DSPI_CORE_DIR}/target/release/libdspi_core.a
)
@@ -50,10 +53,10 @@ elseif(UNIX)
target_include_directories(DSPiConsole PRIVATE ${LIBUSB_INCLUDE_DIRS})
target_link_libraries(DSPiConsole PRIVATE ${LIBUSB_LIBRARIES} pthread dl udev)
- # Optional: KDE blur-behind support
- find_package(KF5WindowSystem QUIET)
- if(KF5WindowSystem_FOUND)
- target_link_libraries(DSPiConsole PRIVATE KF5::WindowSystem)
+ # Optional: KDE blur-behind support (KF6 for Qt6)
+ find_package(KF6WindowSystem QUIET)
+ if(KF6WindowSystem_FOUND)
+ target_link_libraries(DSPiConsole PRIVATE KF6::WindowSystem)
target_compile_definitions(DSPiConsole PRIVATE HAS_KDE_BLUR)
message(STATUS "KDE blur-behind support enabled")
else()
diff --git a/qt/src/main.cpp b/qt/src/main.cpp
index 182a7cf..07b0544 100644
--- a/qt/src/main.cpp
+++ b/qt/src/main.cpp
@@ -106,19 +106,19 @@ static void setupPlatformEffects(QQuickWindow *qw)
// KDE Plasma: request blur behind the sidebar region via KWin
qw->setColor(Qt::transparent);
QRegion sidebarRegion(0, 0, SIDEBAR_WIDTH, qw->height());
- KWindowEffects::enableBlurBehind(qw->winId(), true, sidebarRegion);
+ KWindowEffects::enableBlurBehind(qw, true, sidebarRegion);
// Update blur region when window resizes
QObject::connect(qw, &QWindow::heightChanged, [qw](int h) {
QRegion region(0, 0, SIDEBAR_WIDTH, h);
- KWindowEffects::enableBlurBehind(qw->winId(), true, region);
+ KWindowEffects::enableBlurBehind(qw, true, region);
});
#endif
}
int main(int argc, char *argv[])
{
- QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ // QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
app.setApplicationName("DSPi Console");
app.setOrganizationName("DSPi");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment