Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ set(MKSPECS_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/mkspecs/m
set(QML_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/qml" CACHE STRING "Qml plugin install directory")

set(USE_QQuickStylePluginPrivate OFF)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core QuickControls2)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core QuickControls2 DBus)

# Export all symbols for MinGW since DTK classes lack export macros
if(WIN32 AND NOT MSVC)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols")
endif()

if (${QT_VERSION_MAJOR} STREQUAL "6")
if (${Qt6QuickControls2_VERSION} VERSION_GREATER_EQUAL "6.10.0")
Expand Down
4 changes: 3 additions & 1 deletion examples/exhibition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick QuickControls2)
find_package(Dtk${DTK_NAME_SUFFIX}Core REQUIRED)
find_package(Dtk${DTK_NAME_SUFFIX}Gui REQUIRED)

set(CMAKE_EXE_LINKER_FLAGS "-z relro -z now -z noexecstack -pie -Wl,--as-needed")
if(NOT WIN32)
set(CMAKE_EXE_LINKER_FLAGS "-z relro -z now -z noexecstack -pie -Wl,--as-needed")
endif()

if (DTK5)
set(QML_RCS ${CMAKE_CURRENT_LIST_DIR}/qml.qrc)
Expand Down
3 changes: 2 additions & 1 deletion src/dquickwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ bool DQuickWindowAttachedPrivate::ensurePlatformHandle()
qWarning() << "Failed to enable NoTitlebar for the window:" << window;
return false;
}

#ifndef Q_OS_WIN
Q_ASSERT(DPlatformHandle::isEnabledNoTitlebar(window));
#endif
explicitEnable = Invalid;
D_Q(DQuickWindowAttached);
handle = new DPlatformHandle(window);
Expand Down
5 changes: 3 additions & 2 deletions src/private/dqmlglobalobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
#include <private/qquickitem_p.h>
#endif

#include <DStandardPaths>

Check warning on line 30 in src/private/dqmlglobalobject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DStandardPaths> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DPathBuf>

Check warning on line 31 in src/private/dqmlglobalobject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DPathBuf> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#ifdef Q_OS_UNIX
#include <unistd.h>

Check warning on line 34 in src/private/dqmlglobalobject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <pwd.h>

Check warning on line 35 in src/private/dqmlglobalobject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <pwd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DStandardPaths>
#include <DPathBuf>
#endif

DGUI_USE_NAMESPACE
Expand Down
13 changes: 9 additions & 4 deletions src/private/dquickbehindwindowblur.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

Expand Down Expand Up @@ -64,9 +64,14 @@ void DSGBlendNode::render(const QSGRenderNode::RenderState *state)
p->setCompositionMode(QPainter::CompositionMode_Source);
} else {
#ifndef QT_NO_OPENGL
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
f->glEnable(GL_BLEND);
f->glBlendFunc(GL_ONE, GL_ZERO);
QOpenGLContext *ctx = QOpenGLContext::currentContext();
if (ctx) {
QOpenGLFunctions *f = ctx->functions();
if (f) {
f->glEnable(GL_BLEND);
f->glBlendFunc(GL_ONE, GL_ZERO);
}
}
#endif
}

Expand Down
8 changes: 6 additions & 2 deletions src/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,20 @@ pkg_check_modules(GL REQUIRED IMPORTED_TARGET gl)

include(${PROJECT_SOURCE_DIR}/src/src.cmake)

file(GLOB ASSETS_RCS ${PROJECT_SOURCE_DIR}/src/dtkdeclarative_assets.qrc)
file(GLOB TS_FILES "${PROJECT_SOURCE_DIR}/src/translations/*.ts")

# Use qt_add_resources instead of file(GLOB) for better cross-platform compatibility
if(EXISTS ${PROJECT_SOURCE_DIR}/src/dtkdeclarative_assets.qrc)
qt_add_resources(ASSETS_BINARY ${PROJECT_SOURCE_DIR}/src/dtkdeclarative_assets.qrc)
endif()

add_library(${LIB_NAME}_properties INTERFACE)
add_library(${LIB_NAME}_sources INTERFACE)
target_sources(${LIB_NAME}_sources INTERFACE
${SRCS}
${HEADERS}
${D_HEADERS}
${ASSETS_RCS}
${ASSETS_BINARY}
)

set(DTK_QML_APP_PLUGIN_PATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${LIB_NAME}/qml-app" CACHE STRING "dtk qml app plugin path")
Expand Down
Loading