当前位置: 首页 > news >正文

afsim-2.9.0升级Qt5.15.2

环境

  • Windows 11
  • CMake 4.0.0
  • Visual Studio 2022
  • Qt5.15.2

源码目录结构

|- afsim-2.9.0-win64

|- |- demos

|- |- documentation

|- |- resources

|- |- swdev

|- |- |- build-qt

|- |- |- dependencies

|- |- |- src

|- |- |- |- CMakeLists.txt

参考文章

AFSIM入门教程03.01:Windows下编译

AFSIM入门教程索引

一、afsim-2.9.0升级Qt5.15.2

在这里插入图片描述

  1. 全部替换qt-5.12.11 为 qt-5.15.2

    在这里插入图片描述

  2. 从tools\3rd_party-cmake\qt-5.12.11.cmake 复制tools\3rd_party-cmake\qt-5.15.2.cmake

  3. 修改tools\3rd_party-cmake\qt-5.15.2.cmake

    在这里插入图片描述

  4. swdev\src\CMakeLists.txt 添加

# 设置Qt根目录 - 这将覆盖swdev_acquire_packages自动设置的值
set(qt_ROOT_DIR "D:/Qt/5.15.2/msvc2019_64" CACHE PATH "Path to Qt installation" FORCE)
message(STATUS "Qt根目录已设置为: ${qt_ROOT_DIR}")

或者直接在CMAKEGUI中添加

在这里插入图片描述

  1. swdev\src\tools\3rd_party-cmake\config.cmake
if (usingPackage)set(${pkgBaseName}_ROOT_DIR "${SWDEV_THIRD_PARTY_ROOT}/${pkgname}")include("${CURRENT_LIST_DIR}/${pkg}.cmake")if ("${EXE_TARGET_DIRECTORY}" STREQUAL "")set_property(GLOBAL APPEND PROPERTY SWDEV_ALL_PACKAGES_USED ${pkgBaseName})else()set_property(DIRECTORY ${EXE_TARGET_DIRECTORY} APPEND PROPERTY SWDEV_ALL_PACKAGES_USED ${pkgBaseName})endif()
endif()

修改为

if (usingPackage)# 只有在${pkgBaseName}_ROOT_DIR未设置时才设置它,这样可以允许用户在外部覆盖if(NOT DEFINED ${pkgBaseName}_ROOT_DIR)set(${pkgBaseName}_ROOT_DIR "${SWDEV_THIRD_PARTY_ROOT}/${pkgname}")message(STATUS "自动设置${pkgBaseName}_ROOT_DIR为: ${${pkgBaseName}_ROOT_DIR}")else()message(STATUS "使用用户指定的${pkgBaseName}_ROOT_DIR: ${${pkgBaseName}_ROOT_DIR}")endif()include("${CURRENT_LIST_DIR}/${pkg}.cmake")if ("${EXE_TARGET_DIRECTORY}" STREQUAL "")set_property(GLOBAL APPEND PROPERTY SWDEV_ALL_PACKAGES_USED ${pkgBaseName})else()set_property(DIRECTORY ${EXE_TARGET_DIRECTORY} APPEND PROPERTY SWDEV_ALL_PACKAGES_USED ${pkgBaseName})endif()else()  message(STATUS "文件: ${CMAKE_CURRENT_LIST_FILE} 行: ${CMAKE_CURRENT_LIST_LINE} ${pkgBaseName}_ROOT_DIR:usingPackage= ${usingPackage}")# 只有在${pkgBaseName}_ROOT_DIR未设置时才设置它,这样可以允许用户在外部覆盖if(NOT DEFINED ${pkgBaseName}_ROOT_DIR)message(WARNING "文件: ${CMAKE_CURRENT_LIST_FILE} 行: ${CMAKE_CURRENT_LIST_LINE} ${pkgBaseName}_ROOT_DIR没有找到${${pkgBaseName}_ROOT_DIR}")  else()message(STATUS "使用用户指定的${pkgBaseName}_ROOT_DIR: ${${pkgBaseName}_ROOT_DIR}")include("${CURRENT_LIST_DIR}/${pkg}.cmake")endif()endif()
  1. CMAKE中确保QT路径

    在这里插入图片描述

  2. 如果使用Release则不用添加BUILD_TYPE、CMAKE_BUILD_TYPE ,使用RelWithDebInfo如下

在这里插入图片描述

  • CMAKE_BUILD_TYPE
    在这里插入图片描述

  • swdev\src\wsf_plugins\wsf_oms_uci\source\CMakeLists.txt

    添加 $<$<CONFIG:RelWithDebInfo>:${REL_DLLS}>

   # 2. 修改add_custom_command:复制对应配置的DLL到目标目录add_custom_command(TARGET ${PROJECT_NAME} COMMAND ${CMAKE_COMMAND} -E copy $<$<CONFIG:Debug>:${DBG_DLLS}> $<$<CONFIG:Release>:${REL_DLLS}> $<$<CONFIG:RelWithDebInfo>:${REL_DLLS}>$<TARGET_FILE_DIR:${PROJECT_NAME}>)
  1. swdev\src\tools\utilqt\source\UtQtPieChart.cpp

    包含头文件 #include <QPainterPath>

  2. swdev\src\tools\wkf\core\source\WkfViewer.cpp

包含头文件 #include <QKeyEvent>

  1. swdev\src\tools\wkf\common\source\selectors\WkfImageSelectorWidget.cpp包含头文件 #include <QDragEnterEvent>

    #include <QDropEvent>

  2. swdev\src\core\wsf\source\WsfThreadPool.hpp包含头文件 #include <chrono>

  3. swdev\src\tools\wkf\plugins\TerrainTools\source\LOS_Ruler.cpp包含头文件 #include <QPainterPath>

  4. swdev\src\mystic\plugins\ResultInteractionPlots\source\WaterfallPlot.cpp包含头文件 #include <QWheelEvent>

  5. swdev\src\warlock\warlock_core\source\WkScriptTypes.hpp包含头文件 #include <QString>

    #include <QDataStream>

  6. swdev\src\wizard\lib\source\core\Environment.hpp包含头文件 #include <QFocusEvent>

  7. swdev\src\warlock\plugins\TrackDetailsDisplay\source\TrackDetailsDisplayDialog.cpp包含头文件 #include <QKeyEvent>

  8. swdev\src\mover_creator\source\ConvertBrawlerAircraftDialog.cpp

    // TODO:ERROR
    //geometryObject[0] = vehicleMassObject;
    geometryObject = vehicleMassObject;
    
  9. swdev\src\warlock\plugins\DialogBuilder\source\DialogBuilderMainDialog.cpp包含头文件 #include <QDragEnterEvent>

    #include <QDropEvent>

  10. swdev\src\wizard\plugins\PatternVisualization\source\PatternPolarPlotLayer.cpp包含头文件 #include <QPainterPath>

  11. swdev\src\core\sensor_plot_lib\source\HorizontalMapFunction.cpp加上std::

    在这里插入图片描述

  12. swdev\src\mystic\plugins\ResultTimeController\source\RvTimeControllerToolbarWidgets.cpp包含头文件 #include <QMouseEvent>

  13. swdev\src\wizard\plugins\PatternVisualization\source\PatternPolarPlotLayer.hpp包含头文件 #include <QPainterPath>

  14. swdev\src\warlock\plugins\SixDOF_Tuner\source\TunerMainWidget.cpp

    和swdev\src\mover_creator\source\ScriptGeneratorRigidBodySixDOF.cpp

    和swdev\src\mover_creator\source\AeroLiquidRocketEngine.cpp

    和swdev\src\mover_creator\source\AeroJetEngine.cpp

    和swdev\src\mover_creator\source\AeroRamjetEngine.cpp

    和swdev\src\mover_creator\source\ScriptGeneratorPointMassSixDOF.cpp

    和swdev\src\mover_creator\source\AeroSolidRocketEngine.cpp

    和swdev\src\mover_creator\source\BrawlerConverter.cpp

    和swdev\src\mover_creator\source\VehicleLandingGear.cpp

    和swdev\src\mover_creator\source\ScriptGeneratorSixDOF.cpp

    替换

    在这里插入图片描述

  15. swdev\src\mover_creator\source\SolidRocketEngineWidget.cpp

    #if QT_DEPRECATED_SINCE(5, 15)connect(mUIPtr->specificationsComboBox, &QComboBox::textActivated, this, &SolidRocketEngineWidget::HandleSpecificationsComboBoxChanged);connect(mUIPtr->massComboBox, &QComboBox::textActivated, this, &SolidRocketEngineWidget::HandleMassComboBoxChanged);connect(mUIPtr->altitudeComboBox, &QComboBox::textActivated, this, &SolidRocketEngineWidget::HandleAltitudeComboBoxChanged);connect(mUIPtr->propellantMassComboBox, &QComboBox::textActivated, this, &SolidRocketEngineWidget::HandlePropellantMassComboBoxChanged);
    #elseconnect(mUIPtr->specificationsComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::activated), this, &SolidRocketEngineWidget::HandleSpecificationsComboBoxChanged);connect(mUIPtr->massComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::activated), this, &SolidRocketEngineWidget::HandleMassComboBoxChanged);connect(mUIPtr->altitudeComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::activated), this, &SolidRocketEngineWidget::HandleAltitudeComboBoxChanged);connect(mUIPtr->propellantMassComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::activated), this, &SolidRocketEngineWidget::HandlePropellantMassComboBoxChanged);
    #endif
  16. swdev\src\mover_creator\source\ControlsWidget.cpp

    #if QT_DEPRECATED_SINCE(5, 15)connect(mUIPtr->mActivePilotComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),[=](int index) { this->ControlSystemTypeChanged(mUIPtr->mActivePilotComboBox->itemText(index)); });connect(mUIPtr->mControlSystemTypeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ControlSystemTypeChanged(mUIPtr->mControlSystemTypeComboBox->itemText(index)); });connect(mUIPtr->mYawControlComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });connect(mUIPtr->mWeaponYawControlComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });connect(mUIPtr->mWeaponRollControlComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });connect(mUIPtr->mRollControlSurfacesComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });connect(mUIPtr->mWeaponRollControlSurfacesComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });#elseconnect(mUIPtr->mActivePilotComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);connect(mUIPtr->mControlSystemTypeComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ControlSystemTypeChanged);connect(mUIPtr->mYawControlComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);connect(mUIPtr->mWeaponYawControlComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);connect(mUIPtr->mWeaponRollControlComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);connect(mUIPtr->mRollControlSurfacesComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);connect(mUIPtr->mWeaponRollControlSurfacesComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);#endif....#if QT_DEPRECATED_SINCE(5, 15)connect(mUIPtr->mControlSystemTypeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });connect(mUIPtr->mYawControlMappingComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });connect(mUIPtr->mPitchControlMappingComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });connect(mUIPtr->mRollControlMappingComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) { this->ValueChanged(); });#elseconnect(mUIPtr->mControlSystemTypeComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);connect(mUIPtr->mYawControlMappingComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);connect(mUIPtr->mPitchControlMappingComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);connect(mUIPtr->mRollControlMappingComboBox, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &ControlsWidget::ValueChanged);#endif
  1. swdev\src\mover_creator\source\PerformanceWidget.cpp

    #if QT_DEPRECATED_SINCE(5, 15)curItem->setSelected(true);
    #elsemUIPtr->performanceTestTreeWidget->setItemSelected(curItem, true);
    #endif....#if QT_DEPRECATED_SINCE(5, 15)curItem->setSelected(false);
    #elsemUIPtr->performanceTestTreeWidget->setItemSelected(curItem, false);#endif
    
  2. swdev\src\wizard\plugins\OSMConverter\source\OSMConverterDataContainer.hpp

    #if !QT_DEPRECATED_SINCE(5, 15)
    namespace std
    {template<>
    struct hash<QString>
    {std::size_t operator()(const QString& aString) const { return qHash(aString); }
    };} // namespace std
    #endif
    
  3. swdev\src\wizard\lib\source\map\Platform.cpp

    #if !QT_DEPRECATED_SINCE(5, 15)
    namespace std
    {
    template<>
    struct hash<QString>
    {std::size_t operator()(const QString& s) const { return qHash(s); }
    };
    } // namespace std
    #endif

二、编译

  1. CMakeTargets/ALL_BUILD
  2. CMakeTargets/INSTALL

三、使用

  1. swdev\build-qt\wsf_install\bin 拷贝所以到运行目录swdev\build-qt\RelWithDebInfo 或者 swdev\build-qt\Release

  2. 拷贝资源文件demos、documentation、resources 运行目录的上层wdev\build-qt\

  3. 设置applications/wizard 设置为启动项目

二、编译

  1. CMakeTargets/ALL_BUILD
  2. CMakeTargets/INSTALL

三、使用

  1. swdev\build-qt\wsf_install\bin 拷贝所以到运行目录swdev\build-qt\RelWithDebInfo 或者 swdev\build-qt\Release

  2. 拷贝资源文件demos、documentation、resources 运行目录的上层wdev\build-qt\

  3. 设置applications/wizard 设置为启动项目

    在这里插入图片描述

http://www.dtcms.com/a/582246.html

相关文章:

  • 网站域名实名认证通知最新国际军事新闻
  • 潍坊 营销型网站建设企业网站推广最有效的方法
  • 泰坦科技网站建设wordpress权限说明
  • [AI]关系论
  • 直通车推广计划方案seo关于网站搜索排名关键词的标准评定
  • 网络协议之传统DNS存在的问题以及httpdns
  • Linux——9
  • 广西网站建设证件查询安装wordpress到服务器
  • 电子电气架构 --- 高阶智能辅助驾驶浅析
  • GPT-4o与GPT-5存在七项零点击攻击漏洞
  • 医院信息化建设会议安排网站县级网站
  • 网站建设方案文库wordpress的标签页
  • 17zwd一起做网站官网wordpress开发视频网站模板
  • 仓颉语言:全栈开发新利器,从服务端到鸿蒙的深度解析与实践
  • GitPuk零基础学习,使用GitPuk + Arbess进行CICD自动化部署
  • 部署基于 LNMP 的 Discuz! 论坛服务器
  • Cordova 开发鸿蒙应用完全指南
  • HarmonyOS开发-系统AI视觉能力-图片识别
  • YAML语言
  • ChatBox AI 中配置阿里云百炼模型实现聊天对话
  • 基于 GitCode 云端环境的 CANN ops-math 算子库深度测评:Ascend NPU 上的数学引擎解析
  • php网站本地搭建做采集网站赚钱
  • 03 Model组件及其使用技巧
  • 指针深入第四弹--sizeof和strlen的对比、数组和指针笔试题解析、指针运算笔试题解析
  • 做刷单的网站网站关键词优化遇到的情况和解决方法
  • 【Java】Java 打印字符数组的正确姿势
  • 做两个阿里网站wordpress教程下载
  • Rust 练习册 :Minesweeper与二维数组处理
  • Flink CDC「Data Pipeline」定义与参数速查
  • 电子烟花:科技点亮夜空的艺术