当前位置:网站首页>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);
总结
边栏推荐
- 从色情直播到直播电商
- 2021-05-21
- Network foundation (1)
- Opencv installation and environment configuration - vs2017
- Creative information was surveyed by 2 institutions: greatdb database has been deployed in 9 places
- Input type= "password" how to solve the problem of password automatically brought in
- 变量的解构赋值
- 2021 summary and 2022 outlook
- 对比学习之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments
- 基于DE2 115开发板驱动HC_SR04超声波测距模块【附源码】
猜你喜欢
[untitled]
RationalDMIS2022阵列工件测量
[machine learning 03] Lagrange multiplier method
Using ENSP to do MPLS pseudo wire test
2021 summary and 2022 outlook
Transaction rolled back because it has been marked as rollback only
学习笔记|数据小白使用DataEase制作数据大屏
[C #] the solution of WinForm operation zoom (blur)
Seata 1.3.0 four modes to solve distributed transactions (at, TCC, Saga, XA)
Array object sorting
随机推荐
Process control (creation, termination, waiting, program replacement)
【pyqt】tableWidget里的cellWidget使用信号与槽机制
学习笔记|数据小白使用DataEase制作数据大屏
2021 summary and 2022 outlook
Basic knowledge of process (orphan, zombie process)
自动化测试框架
Unity websocket server
The concept, implementation and analysis of binary search tree (BST)
Deeply understand the characteristics of database transaction isolation
[untitled]
关于在云服务器上(这里用腾讯云)安装mysql8.0并使本地可以远程连接的方法
2022.7.5DAY597
Qtcreator sets multiple qmake
【时间格式工具函数的封装】
The use of list and Its Simulation Implementation
Mpx 插件
Bookmarking - common website navigation for programmers
Go redis Middleware
[untitled]
毕业季|与青春作伴,一起向未来!