Commit 3e3b932
committed
fix: resolve compilation warnings and Qt6 compatibility issues
1. Replaced QScopedPointer with std::unique_ptr for better memory
management and consistency
2. Added Qt6-specific includes (type_traits) for compatibility
3. Updated qAsConst to std::as_const for Qt6 compatibility
4. Fixed time handling in DRecentManager for Qt6 by using QTimeZone
5. Added missing memory header for smart pointers
These changes address compiler warnings and ensure proper functionality
across both Qt5 and Qt6 versions, while modernizing the codebase with
standard C++ features.
fix: 修复编译警告和Qt6兼容性问题
1. 使用std::unique_ptr替代QScopedPointer以获得更好的内存管理和一致性
2. 添加Qt6特定的头文件(type_traits)以保证兼容性
3. 将qAsConst更新为std::as_const以兼容Qt6
4. 在DRecentManager中修复Qt6的时间处理问题,使用QTimeZone
5. 添加缺失的memory头文件以支持智能指针
这些修改解决了编译器警告问题,并确保代码在Qt5和Qt6版本中都能正常工作,同
时使用标准C++特性使代码更现代化。1 parent 97e66aa commit 3e3b932
3 files changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
173 | 177 | | |
174 | 178 | | |
175 | 179 | | |
176 | | - | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | | - | |
| 183 | + | |
180 | 184 | | |
181 | | - | |
182 | | - | |
| 185 | + | |
| 186 | + | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| |||
370 | 374 | | |
371 | 375 | | |
372 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
373 | 380 | | |
| 381 | + | |
374 | 382 | | |
375 | 383 | | |
376 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| |||
0 commit comments