【QT】Windows下在VS-Code将本地图片加载至资源文件(亲测可用)
Wyn_:
我在cmake中使用的是add_executable()这个方法[code=cpp]
# add_executable(${PROJECT_NAME}
# ${customer_database}
# ${customer_mainControl}
# ${customer_HPP} ${RCC_FILES} ${customer_SRCS}
# ${customer_utility}
# ${customer_window_customControls}
# ${customer_window_qcWin}
# ${customer_window_recordWin}
# ${customer_window_settingWin}
# ${customer_window_testWin}
# ${customer_window_toolBar}
# ${customer_window}
#第四行的【resource/resource.qrc】路径,原本代码为上面注释中的第四行所示:${RCC_FILES},为了你方便看,我改成了【 resource/resource.qrc】
add_executable(${PROJECT_NAME}
${customer_database}
${customer_mainControl}
${customer_HPP} resource/resource.qrc ${customer_SRCS}
${customer_utility}
${customer_window_customControls}
${customer_window_qcWin}
[/code]
|