fix: fix slot connect fail log when running app

- fix slot connect fail log when running app
- fix potential memory leak
This commit is contained in:
2026-09-28 10:40:14 +08:00
parent c060ba5596
commit 851b7c53c6
3 changed files with 8 additions and 1 deletions
+7
View File
@@ -143,6 +143,13 @@ else()
qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES)
endif()
# YYC MARK:
# We use this to disable that Qt UIC generate code like `QMetaObject::connectSlotsByName(foobar);`
# for the header file of `.ui` file, which cause this application outputs log at runtime like
# `qt.core.qmetaobject.connectslotsbyname: QMetaObject::connectSlotsByName: No matching signal for on_actionXxx_triggered()`,
# because we only use UIC for building user interface and all signals and actions are managed by ourselves.
set_target_properties(${EXE_NAME} PROPERTIES AUTOUIC_OPTIONS "-a")
# YYC MARK:
# This is essential, otherwise Qt UIC generated UI header file
# can not find our header files if there are custom widgets inside UI file.