Skip to content
Merged
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
5 changes: 4 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export DEB_CFLAGS_MAINT_APPEND = -Wall
export DEB_CXXFLAGS_MAINT_APPEND = -Wall
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-E

# reproducible编译参数
DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_BUILD_RPATH=ON

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

VERSION = $(DEB_VERSION_UPSTREAM)
Expand All @@ -20,4 +23,4 @@ BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-
dh $@

override_dh_auto_configure:
dh_auto_configure -- -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=ON -DBUILD_VERSION=$(BUILD_VER) -DDTK_VERSION=$(PACK_VER)
dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS) -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=ON -DBUILD_VERSION=$(BUILD_VER) -DDTK_VERSION=$(PACK_VER)
2 changes: 0 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
set(CHAMELEON_PATH "${PROJECT_BINARY_DIR}/plugins")
add_definitions(
-DCHAMELEON_PATH="${CHAMELEON_PATH}"
-DQT_DEPRECATED_WARNINGS
)
add_subdirectory(exhibition)
Expand Down
7 changes: 4 additions & 3 deletions examples/exhibition/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,17 @@ int main(int argc, char **argv)

QQmlApplicationEngine engine;

engine.addImportPath(CHAMELEON_PATH);
const QString chameleonPath = QStringLiteral("%1/../../../plugins").arg(QGuiApplication::applicationDirPath());
engine.addImportPath(chameleonPath);
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QQuickStyle::addStylePath(CHAMELEON_PATH);
QQuickStyle::addStylePath(chameleonPath);
// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
#else
// QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
#endif

#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) && defined(QT_NO_DEBUG)
QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon");
QQuickStyle::setStyle(chameleonPath"/Chameleon");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): String concatenation with chameleonPath may not work as intended.

Use chameleonPath + "/Chameleon" for correct QString concatenation in C++.

#else
QQuickStyle::setStyle("Chameleon");
#endif
Expand Down
7 changes: 4 additions & 3 deletions examples/qml-inspect/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ int main(int argc, char *argv[])

QQmlApplicationEngine engine;

engine.addImportPath(CHAMELEON_PATH);
const QString chameleonPath = QStringLiteral("%1/../../../plugins").arg(QGuiApplication::applicationDirPath());
engine.addImportPath(chameleonPath);
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QQuickStyle::addStylePath(CHAMELEON_PATH);
QQuickStyle::addStylePath(chameleonPath);
// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
#else
// QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
#endif

#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) && defined(QT_NO_DEBUG)
QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon");
QQuickStyle::setStyle(chameleonPath"/Chameleon");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Invalid string concatenation for style path.

Use chameleonPath + "/Chameleon" to concatenate the path correctly.

#else
QQuickStyle::setStyle("Chameleon");
#endif
Expand Down
2 changes: 1 addition & 1 deletion qt6/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ install(EXPORT Dtk${DTK_VERSION_MAJOR}DeclarativeTargets NAMESPACE Dtk${DTK_VERS
install(FILES ${QM_FILES} DESTINATION "${TRANSLATIONS_INSTALL_PATH}")
# Install plugin
install(TARGETS ${PLUGIN_NAME} DESTINATION "${QML_INSTALL_DIR}/${URI_PATH}")
install(DIRECTORY "${PLUGIN_OUTPUT_DIR}/${URI_PATH}/" DESTINATION "${QML_INSTALL_DIR}/${URI_PATH}")
install(FILES "${PLUGIN_OUTPUT_DIR}/${URI_PATH}/qmldir" DESTINATION "${QML_INSTALL_DIR}/${URI_PATH}")