From 851b7c53c61e2c0c64ab6c33346c1204574c9956 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Mon, 28 Sep 2026 10:40:14 +0800 Subject: [PATCH] fix: fix slot connect fail log when running app - fix slot connect fail log when running app - fix potential memory leak --- CMakeLists.txt | 7 +++++++ app/actionmanager.h | 1 - app/mainwindow.cpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0681a04..49d9102 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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. diff --git a/app/actionmanager.h b/app/actionmanager.h index cbc4456..251caa6 100644 --- a/app/actionmanager.h +++ b/app/actionmanager.h @@ -22,7 +22,6 @@ public: void setupAction(MainWindow * mainWindow); void setupShortcuts(); -public slots: void updateActionState(PlaylistManager* pm, GraphicsView* gv); public: diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index 9a8234e..e9bd138 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -180,6 +180,7 @@ MainWindow::MainWindow(QWidget *parent) MainWindow::~MainWindow() { + delete m_am; delete ui; }