添加了资源文件

This commit is contained in:
jackfiled 2022-06-16 21:45:49 +08:00
parent 48947253f2
commit fa843258ce
4 changed files with 16 additions and 2 deletions

View File

@ -1,10 +1,13 @@
cmake_minimum_required(VERSION 3.10)
project(auto_bus_gui)
file(GLOB_RECURSE QRC_SOURCE_FILES ${PROJECT_SOURCE_DIR}/*.qrc)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(QRC_SOURCE_FILES Resources.qrc)
set(CMAKE_PREFIX_PATH "C:/Users/ricardo.DESKTOP-N6OVBK5/Programs/Qt/6.1.3/msvc2019_64")
@ -14,6 +17,9 @@ find_package(Qt6 COMPONENTS
Widgets
REQUIRED)
qt6_add_resources(QRC_FILES ${QRC_SOURCE_FILES})
SOURCE_GROUP("Resource Files" FILES ${QRC_SOURCE_FILES})
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/src/header
@ -21,7 +27,7 @@ include_directories(
aux_source_directory(${PROJECT_SOURCE_DIR}/src SRCS)
add_executable(auto_bus_gui main.cpp ${SRCS})
add_executable(auto_bus_gui main.cpp ${SRCS} ${QRC_FILES})
target_link_libraries(auto_bus_gui
Qt::Core

8
Resources.qrc Normal file
View File

@ -0,0 +1,8 @@
<RCC>
<qresource prefix="/stop_pic">
<file>picture/stop.png</file>
</qresource>
<qresource prefix="/bus_pic">
<file>picture/bus.png</file>
</qresource>
</RCC>

BIN
picture/bus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
picture/stop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB