lxg

导航

 

2024年1月23日

摘要: 结构体对齐: 公式1:前面的地址必须是后面的地址正数倍,不是就补齐 公式2:整个Struct的地址必须是最大字节的整数倍 练习: Struct E1 { int a;char b; char c}e1; 第一地址肯定存放a是4Byte地址, 第二地址,b要1Byte的地址, 来欢迎公式一登场: 4 阅读全文
posted @ 2024-01-23 20:00 lxg_7105 阅读(4) 评论(0) 推荐(0) 编辑
 

2024年1月17日

摘要: template typename std::enable_if<std::is_arithmetic::value, string>::type ToString(T& t) { return std::to_string(t); } template typename std::enable_i 阅读全文
posted @ 2024-01-17 20:32 lxg_7105 阅读(3) 评论(0) 推荐(0) 编辑
 

2023年12月15日

摘要: std::is_same,std::enable_if,std::is_integral template<typename T> bool isZero(T v) { if (std::is_same<T, float>::value) { return (fabs(v) < FLT_EPSILO 阅读全文
posted @ 2023-12-15 16:12 lxg_7105 阅读(1) 评论(0) 推荐(0) 编辑
 

2023年11月15日

摘要: .h文件 // QComboBox 委托 class ComBoxDelegate final : public QItemDelegate { Q_OBJECT public: ComBoxDelegate(const QStringList& items, QObject* parent = 0 阅读全文
posted @ 2023-11-15 15:07 lxg_7105 阅读(208) 评论(0) 推荐(0) 编辑
 

2023年8月29日

摘要: https://blog.csdn.net/weixin_43935474/article/details/124922897 // Load(); // QMetaObject::invokeMethod(this,"Load",Qt::QueuedConnection);//无参数,Queued 阅读全文
posted @ 2023-08-29 16:28 lxg_7105 阅读(172) 评论(0) 推荐(0) 编辑
 

2023年8月18日

摘要: 点击查看代码 ``` //定义成宏 publicDefine.h // PIMPL模式声明 #define PIMPL_DEFINE(Classname) \ const Classname##Impl* GetImpl() const; \ Classname##Impl* GetImpl(); 阅读全文
posted @ 2023-08-18 09:10 lxg_7105 阅读(10) 评论(0) 推荐(0) 编辑
 

2023年8月17日

摘要: 点击查看代码 ``` class CustomHeaderView : public QHeaderView { Q_OBJECT public: CustomHeaderView(Qt::Orientation orientation, QWidget* parent = nullptr) : Q 阅读全文
posted @ 2023-08-17 15:40 lxg_7105 阅读(123) 评论(0) 推荐(0) 编辑
 

2023年8月8日

摘要: //递归遍历 点击查看代码 ``` void iterateTreeViewNodes(const QModelIndex& parentIndex, QStandardItemModel* model, QVector& items) { int rowCount = model->rowCoun 阅读全文
posted @ 2023-08-08 10:19 lxg_7105 阅读(92) 评论(0) 推荐(0) 编辑
 

2023年8月3日

摘要: //参考:https://blog.csdn.net/wmy19890322/article/details/121427697 点击查看代码 ``` //创建对象 template T* CreateInstance(Args... args) { return new T(std::forwar 阅读全文
posted @ 2023-08-03 10:23 lxg_7105 阅读(5) 评论(0) 推荐(0) 编辑
 

2023年7月25日

摘要: //参考:https://dgrt.cn/a/1328707.html?action=onClick void QtWidgetsApplication1::initTreeView(){ ui.treeView->setEditTriggers(QTreeView::NoEditTriggers) 阅读全文
posted @ 2023-07-25 16:35 lxg_7105 阅读(371) 评论(0) 推荐(0) 编辑