对于这种 不同布局添加不同控件 的情况,可以采用以下几种简化方法: 方法 1:使用 std::pair 或 std::tuple 配对(C++17 推荐) for (auto [layout, widget] : {std::pair{m_layoutMistakeCalibrate,