当前位置:网站首页>Dynamic layout management
Dynamic layout management
2022-07-03 10:03:00 【Master Hao】
if(nullptr == _hLayout)
{
_hLayout=new QHBoxLayout(this);
}
// If the original layout exists , Delete layout
// if(this->layout()!=nullptr)
{
// First, empty the original layout control
while(_hLayout->count()!=0)
{
auto item=_hLayout->itemAt(0);
// If it is a child control , Delete ;
if(QWidget* widget=item->widget())
{
qDebug()<<" Deleted a child control ";
delete widget;
widget=nullptr;
}
// If it's a bullet spring , Delete :
if(QSpacerItem* spaceItem=item->spacerItem())
{
qDebug()<<" Deleted a spring ";
delete spaceItem;
spaceItem=nullptr;
}
// Remove the sub object itself
_hLayout->removeItem(item);
// Delete the object itself
delete item;
item=nullptr;
}
// Finally delete layout
// delete this->layout();
}
// New layout
// _hLayout=new QHBoxLayout();
_hLayout->setMargin(0);
_hLayout->setSpacing(0);
These codes cannot be put into paintevent Inside
边栏推荐
- 单片机学到什么程度能找到工作,这个标准不好量化
- Windows下MySQL的安装和删除
- LeetCode - 673. 最长递增子序列的个数
- CEF download, compile project
- The data read by pandas is saved to the MySQL database
- (2) New methods in the interface
- 2.Elment Ui 日期选择器 格式化问题
- yocto 技术分享第四期:自定义增加软件包支持
- 4G module initialization of charge point design
- Application of 51 single chip microcomputer timer
猜你喜欢

Retinaface: single stage dense face localization in the wild

The new series of MCU also continues the two advantages of STM32 product family: low voltage and energy saving

内存数据库究竟是如何发挥内存优势的?

JS基础-原型原型链和宏任务/微任务/事件机制

编程思想比任何都重要,不是比谁多会用几个函数而是比程序的理解

I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first

Blue Bridge Cup for migrant workers majoring in electronic information engineering

学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里

当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学

Windows下MySQL的安装和删除
随机推荐
The third paper of information system project manager in soft examination
LeetCode - 919. 完全二叉树插入器 (数组)
Working mode of 80C51 Serial Port
Liquid crystal display
4G module IMEI of charging pile design
[keil5 debugging] warning:enumerated type mixed with other type
Circular queue related design and implementation reference 1
2021-10-27
QT detection card reader analog keyboard input
03 fastjason solves circular references
SCM is now overwhelming, a wide variety, so that developers are overwhelmed
SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
Quelle langue choisir pour programmer un micro - ordinateur à puce unique
When you need to use some functions of STM32, but 51 can't realize them, 32 naturally doesn't need to learn
Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
Screen display of charging pile design -- led driver ta6932
Toolbutton property settings
03 fastjason solves circular references
Project cost management__ Topic of comprehensive calculation
My openwrt learning notes (V): choice of openwrt development hardware platform - mt7688