当前位置:网站首页>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);
总结
边栏推荐
- 滚动踩坑--UNI_APP(八)
- Transaction rolled back because it has been marked as rollback only
- Qtcreator sets multiple qmake
- RationalDMIS2022 高级编程宏程序
- [untitled]
- 关于SIoU《SIoU Loss: More Powerful Learning for Bounding Box Regression Zhora Gevorgyan 》的一些看法及代码实现
- Debezium同步之Debezium架构详解
- 基于Retrofit框架的金山API翻译功能案例
- How to use cherry pick?
- RationalDMIS2022阵列工件测量
猜你喜欢

Unity script generates configurable files and loads

Array object sorting

基于华为云IOT设计智能称重系统(STM32)

uniCloud
![[untitled]](/img/8e/e968d4629004bb0c3ee70328b6777b.jpg)
[untitled]

Ping tool ICMP message learning

PostgreSQL中的表复制

"Dream Cup" 2017 Jiangsu information and future primary school summer camp it expert PK program design questions

How to remove addition and subtraction from inputnumber input box

Antd select selector drop-down box follows the scroll bar to scroll through the solution
随机推荐
Wallhaven wallpaper desktop version
RationalDMIS2022阵列工件测量
[OneNote] can't connect to the network and can't sync the problem
Kitex 重试机制
请问申购新股哪个证券公司开户是最好最安全的
Project ERROR: Unknown module(s) in QT: core gui
IDEA快捷键大全
[untitled]
[untitled]
基于Retrofit框架的金山API翻译功能案例
Ffmpeg record a video command from RTSP
【C#】WinForm运行缩放(变糊)的解决方法
Creative information was surveyed by 2 institutions: greatdb database has been deployed in 9 places
Basic knowledge of process (orphan, zombie process)
2021 summary and 2022 outlook
学习笔记|数据小白使用DataEase制作数据大屏
[untitled]
Unity websocket server
自动化测试框架
Realize ray detection, drag the mouse to move the object and use the pulley to scale the object