当前位置:网站首页>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
边栏推荐
- 自动装箱与拆箱了解吗?原理是什么?
- 【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
- Fundamentals of Electronic Technology (III)_ Chapter 2 principle of amplification circuit__ Crystal triode and field effect triode
- (1) What is a lambda expression
- Fundamentals of Electronic Technology (III)__ Chapter 6 combinational logic circuit
- 嵌入式系统没有特别明确的定义
- yocto 技術分享第四期:自定義增加軟件包支持
- Screen display of charging pile design -- led driver ta6932
- El table X-axis direction (horizontal) scroll bar slides to the right by default
- Toolbutton property settings
猜你喜欢

Stm32f407 key interrupt

QT is a method of batch modifying the style of a certain type of control after naming the control

2021-10-27

使用密钥对的形式连接阿里云服务器

Crash工具基本使用及实战分享

03 fastjason solves circular references

2021-10-28

There is no shortcut to learning and development, and there is almost no situation that you can learn faster by leading the way

In third tier cities and counties, it is difficult to get 10K after graduation

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
随机推荐
自動裝箱與拆箱了解嗎?原理是什麼?
Assignment to '*' form incompatible pointer type 'linkstack' {aka '*'} problem solving
LeetCode - 460 LFU 缓存(设计 - 哈希表+双向链表 哈希表+平衡二叉树(TreeSet))*
I think all friends should know that the basic law of learning is: from easy to difficult
对于新入行的同学,如果你完全没有接触单片机,建议51单片机入门
byte alignment
ADS simulation design of class AB RF power amplifier
SCM is now overwhelming, a wide variety, so that developers are overwhelmed
LeetCode - 508. 出现次数最多的子树元素和 (二叉树的遍历)
Fundamentals of Electronic Technology (III)_ Integrated operational amplifier and its application__ Basic arithmetic circuit
手机都算是单片机的一种,只不过它用的硬件不是51的芯片
QT is a method of batch modifying the style of a certain type of control after naming the control
Quelle langue choisir pour programmer un micro - ordinateur à puce unique
Embedded systems are inherently flawed. Compared with the Internet, there are so many holes that it is simply difficult to walk away from
Happy Dragon Boat Festival—— Zongzi written by canvas~~~~~
自动装箱与拆箱了解吗?原理是什么?
There is no shortcut to learning and development, and there is almost no situation that you can learn faster by leading the way
01仿B站项目业务架构
要選擇那種語言為單片機編寫程序呢
is_ power_ of_ 2 judge whether it is a multiple of 2