使用 nlohmann/json 序列化 2022-05-23 c++ 172 次阅读 0 评论 nlohmann/json JSON for Modern C++ #include <iostream> #include <fstream> #include <vector> #include <optional> #include "json.hpp" namespace nl = nlohmann; enum...
QtQuick/QML 中 TableView 改变 columnWidth 和 rowHeight 的问题 - TableView 刷新布局的方法 2020-08-26 c++ 92 次阅读 0 评论 最近在项目中使用到了 QML 的 TableView 因为需要动态调整每一个 Cell 大小。所以需要用到刷新。 直接看官方的例子:import QtQuick 2.12 import TableModel 0.1 TableView { anchors.fill: parent columnSpacing: 1 rowSpacing: 1 cli...
Modern C++ 的功能特性 2020-07-13 c++ 59 次阅读 0 评论 刚刚毕业,开始了社畜生涯,谁能想到公司使用的还是VS2010(有限的C++11支持),预期会转移到VS2015(何年何月)。本文记录一下那些常用的C++11后添加的功能特性。(每天写着写着老是被编译器暴打,希望以后能用上现代C++)auto 关键字C++11 ,VS2010 支持,,常用于遍历等情况#include <iostream> #include <vector&g...