当前位置:网站首页>Qt 实现容器的DELETE的方式
Qt 实现容器的DELETE的方式
2022-07-07 09:10:00 【InfoQ】
前提摘要
- 他可以任意存储,具有不限量的优点。
- 再删除中间的某一个数据后,后续的数据会自动补齐,不会造成浪费。
delete 容器的方法一:
for (std::vector<QCheckBox*>::iterator itvet = m_vetAddCheckBoxControls.begin(); itvet != m_vetAddCheckBoxControls.end(); itvet++)
{
if(*itvet)
{
delete *itvet;
*itvet = nullptr;
}
}
m_vetAddCheckBoxControls.clear();
delete 容器的方法二:
vector<QCheckBox*>().swap(m_vetAddCheckBoxControls);
总结
边栏推荐
- 基于Retrofit框架的金山API翻译功能案例
- Antd select selector drop-down box follows the scroll bar to scroll through the solution
- 【时间格式工具函数的封装】
- SQL Server knowledge gathering 9: modifying data
- PR Lecture Notes
- Laya common script commands
- 创意信息获2家机构调研:GreatDB 数据库已在9地部署
- 2021 summary and 2022 outlook
- When initializing 'float', what is the difference between converting to 'float' and adding 'f' as a suffix?
- Go slice comparison
猜你喜欢
自动化测试框架
Antd select selector drop-down box follows the scroll bar to scroll through the solution
90后,辞职创业,说要卷死云数据库
Verilog 实现数码管显视驱动【附源码】
从色情直播到直播电商
通过 Play Integrity API 的 nonce 字段提高应用安全性
The use of list and Its Simulation Implementation
Shardingsphere sub database and table examples (logical table, real table, binding table, broadcast table, single table)
技术分享 | 抓包分析 TCP 协议
测试优惠券要怎么写测试用例?
随机推荐
[machine learning 03] Lagrange multiplier method
The opacity value becomes 1%
软件设计之——“高内聚低耦合”
基于DE2 115开发板驱动HC_SR04超声波测距模块【附源码】
The concept, implementation and analysis of binary search tree (BST)
Ffmpeg record a video command from RTSP
[untitled]
Go-Redis 中间件
2021-04-23
变量的解构赋值
CentOS系统下Redis安装和自启动配置的步骤
V-for img SRC rendering fails
2021-04-08
seata 1.3.0 四种模式解决分布式事务(AT、TCC、SAGA、XA)
Antd select selector drop-down box follows the scroll bar to scroll through the solution
Vscode 尝试在目标目录创建文件时发生一个错误:拒绝访问【已解决】
[pyqt] the cellwidget in tablewidget uses signal and slot mechanism
Verilog 实现数码管显视驱动【附源码】
How to get hardware information in unity
The fifth training assignment