当前位置:网站首页>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);
总结
边栏推荐
猜你喜欢

Deep understanding of Apache Hudi asynchronous indexing mechanism

对比学习之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments

RationalDMIS2022 高级编程宏程序

从色情直播到直播电商

The use of list and Its Simulation Implementation

学习笔记|数据小白使用DataEase制作数据大屏

【C#】WinForm运行缩放(变糊)的解决方法

90后,辞职创业,说要卷死云数据库

What if copying is prohibited?

Basic knowledge of process (orphan, zombie process)
随机推荐
学习笔记|数据小白使用DataEase制作数据大屏
Galaxy Kirin desktop operating system installation postgresql13 (source code installation)
2021-04-23
[untitled]
面试被问到了解哪些开发模型?看这一篇就够了
CentOS系统下Redis安装和自启动配置的步骤
[untitled]
Which securities company is the best and safest to open an account for the subscription of new shares
Using ENSP to do MPLS pseudo wire test
The sixth training assignment
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
2022.7.4DAY596
Idea shortcut keys
Activity生命周期
Unity script visualization about layout code
Kitex 重试机制
The use of list and Its Simulation Implementation
Compile QT project script with qmake
mif 文件格式记录
Deconstruction and assignment of variables