当前位置:网站首页>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);
总结
边栏推荐
- 2022.7.6DAY598
- Mpx 插件
- 数据库同步工具 DBSync 新增对MongoDB、ES的支持
- 普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
- Antd select selector drop-down box follows the scroll bar to scroll through the solution
- Basic knowledge of process (orphan, zombie process)
- PostgreSQL中的表复制
- Web端自动化测试失败的原因
- Qtcreator sets multiple qmake
- Long list performance optimization scheme memo
猜你喜欢

Using ENSP to do MPLS pseudo wire test

2021 summary and 2022 outlook

面试被问到了解哪些开发模型?看这一篇就够了

Simple and easy to modify spring frame components

Avoid mutating a prop directly since the value will be overwritten whenever the parent component

JS add spaces to the string

The post-90s resigned and started a business, saying they would kill cloud database

The database synchronization tool dbsync adds support for mongodb and es

electron添加SQLite数据库

MPX plug-in
随机推荐
uniCloud
[OneNote] can't connect to the network and can't sync the problem
Template initial level template
Deep understanding of Apache Hudi asynchronous indexing mechanism
Compile QT project script with qmake
Verilog 实现数码管显视驱动【附源码】
Wallhaven壁纸桌面版
The eighth training assignment
[untitled]
测试开发基础,教你做一个完整功能的Web平台之环境准备
[untitled]
VIM命令模式与输入模式切换
面试被问到了解哪些开发模型?看这一篇就够了
RationalDMIS2022 高级编程宏程序
The sixth training assignment
Ffmpeg record a video command from RTSP
【C#】WinForm运行缩放(变糊)的解决方法
mif 文件格式记录
Kitex 重试机制
Get pictures through opencv, change channels and save them