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

Mysql的json格式查询
![[OneNote] can't connect to the network and can't sync the problem](/img/28/9a02b1da0f43889989a9539c9fb6b6.png)
[OneNote] can't connect to the network and can't sync the problem

2021 summary and 2022 outlook

PostgreSQL中的表复制

关于SIoU《SIoU Loss: More Powerful Learning for Bounding Box Regression Zhora Gevorgyan 》的一些看法及代码实现

IDEA快捷键大全

测试优惠券要怎么写测试用例?

测试开发基础,教你做一个完整功能的Web平台之环境准备
![[untitled]](/img/8e/e968d4629004bb0c3ee70328b6777b.jpg)
[untitled]

shardingsphere分库分表示例(逻辑表,真实表,绑定表,广播表,单表)
随机推荐
Template initial level template
自动化测试框架
Typescript interface inheritance
[pyqt] the cellwidget in tablewidget uses signal and slot mechanism
How to play video on unityui
2021-04-08
When initializing 'float', what is the difference between converting to 'float' and adding 'f' as a suffix?
The opacity value becomes 1%
Mysql的json格式查询
Unity downloads files through the server address
Avoid mutating a prop directly since the value will be overwritten whenever the parent component
毕业季|与青春作伴,一起向未来!
uniCloud
解决VSCode只能开两个标签页的问题
oracle常见锁表处理方式
Simple and easy to modify spring frame components
Idea shortcut keys
Arduino receives and sends strings
Hash / (understanding, implementation and application)
Input type= "password" how to solve the problem of password automatically brought in