当前位置:网站首页>QT implements the delete method of the container
QT implements the delete method of the container
2022-07-07 11:17:00 【InfoQ】
Summary of premises
- He can store at will , It has unlimited advantages .
- After deleting a certain data in the middle , Subsequent data will be automatically supplemented , No waste .
delete Method 1 of container :
for (std::vector<QCheckBox*>::iterator itvet = m_vetAddCheckBoxControls.begin(); itvet != m_vetAddCheckBoxControls.end(); itvet++)
{
if(*itvet)
{
delete *itvet;
*itvet = nullptr;
}
}
m_vetAddCheckBoxControls.clear();
delete Method 2 of container :
vector<QCheckBox*>().swap(m_vetAddCheckBoxControls);
summary
边栏推荐
猜你喜欢
How to use cherry pick?
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
Seata 1.3.0 four modes to solve distributed transactions (at, TCC, Saga, XA)
Array object sorting
如何在博客中添加Aplayer音乐播放器
How to remove addition and subtraction from inputnumber input box
测试开发基础,教你做一个完整功能的Web平台之环境准备
解决VSCode只能开两个标签页的问题
从色情直播到直播电商
Mysql的json格式查询
随机推荐
PR Lecture Notes
Unity downloads files through the server address
How to get hardware information in unity
[untitled]
Add a self incrementing sequence number to the antd table component
Table replication in PostgreSQL
Static semantic check of clang tidy in cicd
Web端自动化测试失败的原因
Get pictures through opencv, change channels and save them
The database synchronization tool dbsync adds support for mongodb and es
MIF file format record
基于Retrofit框架的金山API翻译功能案例
uniCloud
oracle常见锁表处理方式
JS add spaces to the string
基于DE2 115开发板驱动HC_SR04超声波测距模块【附源码】
Multithreaded application (thread pool, singleton mode)
uniapp 在onLaunch中跳转页面后,点击事件失效解决方法
2021-05-21
[untitled]