当前位置:网站首页>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
边栏推荐
- Synchronization control between tasks
- (2) New methods in the interface
- Stm32f407 key interrupt
- 2020-08-23
- 2021-01-03
- Gif image analysis drawing RGB to YUV table lookup method to reduce CPU occupancy
- Emballage automatique et déballage compris? Quel est le principe?
- uniapp 实现微信小程序全局分享及自定义分享按钮样式
- 使用密钥对的形式连接阿里云服务器
- Gpiof6, 7, 8 configuration
猜你喜欢

ADS simulation design of class AB RF power amplifier

Oracle数据库 SQL语句执行计划、语句跟踪与优化实例

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

El table X-axis direction (horizontal) scroll bar slides to the right by default

03 fastjason solves circular references

单片机现在可谓是铺天盖地,种类繁多,让开发者们应接不暇

嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走

CEF download, compile project

Basic knowledge of communication interface

Swing transformer details-1
随机推荐
Embedded systems are inherently flawed. Compared with the Internet, there are so many holes that it is simply difficult to walk away from
Uniapp realizes global sharing of wechat applet and custom sharing button style
4G module board level control interface designed by charging pile
Positive and negative sample division and architecture understanding in image classification and target detection
My notes on intelligent charging pile development (II): overview of system hardware circuit design
Drive and control program of Dianchuan charging board for charging pile design
内存数据库究竟是如何发挥内存优势的?
2021-11-11 standard thread library
Application of 51 single chip microcomputer timer
LeetCode - 460 LFU 缓存(设计 - 哈希表+双向链表 哈希表+平衡二叉树(TreeSet))*
(1) What is a lambda expression
单片机现在可谓是铺天盖地,种类繁多,让开发者们应接不暇
Circular queue related design and implementation reference 1
2020-08-23
Notes on C language learning of migrant workers majoring in electronic information engineering
JS foundation - prototype prototype chain and macro task / micro task / event mechanism
[combinatorics] Introduction to Combinatorics (combinatorial idea 3: upper and lower bound approximation | upper and lower bound approximation example Remsey number)
Pymssql controls SQL for Chinese queries
Exception handling of arm
CEF download, compile project