添加了资源文件
This commit is contained in:
parent
48947253f2
commit
fa843258ce
|
@ -1,10 +1,13 @@
|
||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(auto_bus_gui)
|
project(auto_bus_gui)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE QRC_SOURCE_FILES ${PROJECT_SOURCE_DIR}/*.qrc)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_AUTOUIC 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")
|
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
|
Widgets
|
||||||
REQUIRED)
|
REQUIRED)
|
||||||
|
|
||||||
|
qt6_add_resources(QRC_FILES ${QRC_SOURCE_FILES})
|
||||||
|
SOURCE_GROUP("Resource Files" FILES ${QRC_SOURCE_FILES})
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${PROJECT_SOURCE_DIR}/include
|
${PROJECT_SOURCE_DIR}/include
|
||||||
${PROJECT_SOURCE_DIR}/src/header
|
${PROJECT_SOURCE_DIR}/src/header
|
||||||
|
@ -21,7 +27,7 @@ include_directories(
|
||||||
|
|
||||||
aux_source_directory(${PROJECT_SOURCE_DIR}/src SRCS)
|
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
|
target_link_libraries(auto_bus_gui
|
||||||
Qt::Core
|
Qt::Core
|
||||||
|
|
8
Resources.qrc
Normal file
8
Resources.qrc
Normal 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
BIN
picture/bus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
BIN
picture/stop.png
Normal file
BIN
picture/stop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
Loading…
Reference in New Issue
Block a user