Skip to content

Commit 15782ce

Browse files
committed
将代码示例改为 CMake 管理,简化结构与文件
1 parent f3a91a6 commit 15782ce

9 files changed

+27
-200
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@ node_modules/
3939

4040
.vscode/
4141
.vs/
42-
x64/
42+
x64/
43+
out/
44+
45+
CMakePresets.json
46+
CMakeUserPresets.json
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
project(async_progress_bar VERSION 0.1 LANGUAGES CXX)
4+
5+
set(CMAKE_AUTOUIC YES)
6+
set(CMAKE_AUTOMOC ON)
7+
set(CMAKE_AUTORCC ON)
8+
9+
set(CMAKE_CXX_STANDARD 17)
10+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
11+
12+
find_package(Qt6 REQUIRED Widgets)
13+
14+
set(PROJECT_SOURCES
15+
main.cpp
16+
async_progress_bar.cpp
17+
)
18+
19+
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})
20+
21+
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets)

code/04同步操作/async_progress_bar/async_progress_bar.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <thread>
99
#include <future>
1010
#include <chrono>
11-
#include <format>
1211
#include "ui_async_progress_bar.h"
1312

1413
using namespace std::chrono_literals;

code/04同步操作/async_progress_bar/async_progress_bar.qrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

code/04同步操作/async_progress_bar/async_progress_bar.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.

code/04同步操作/async_progress_bar/async_progress_bar.vcxproj

Lines changed: 0 additions & 112 deletions
This file was deleted.

code/04同步操作/async_progress_bar/async_progress_bar.vcxproj.filters

Lines changed: 0 additions & 44 deletions
This file was deleted.

code/04同步操作/async_progress_bar/async_progress_bar.vcxproj.user

Lines changed: 0 additions & 12 deletions
This file was deleted.

md/04同步操作.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ void task(){
10081008

10091009
### 项目说明
10101010

1011-
项目使用 Visual Studio 编写,可以直接安装 Qt 插件后打开。项目结构简单,所有界面与设置均通过代码控制,无需进行其他 UI 操作。重点关注 `async_progress_bar.h``async_progress_bar.cpp``main.cpp` 这三个文件,它们位于仓库的 **`code`** 文件夹中。
1011+
项目使用 Visual Studio + CMake,可以直接安装 Qt 插件后打开此项目。项目结构简单,所有界面与设置均通过代码控制,无需进行其他 UI 操作。只需关注 `async_progress_bar.h``async_progress_bar.cpp``main.cpp` 这三个文件,它们位于仓库的 **`code`** 文件夹中。
10121012

10131013
### 完整代码实现
10141014

0 commit comments

Comments
 (0)