当前位置:网站首页>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
边栏推荐
- The new series of MCU also continues the two advantages of STM32 product family: low voltage and energy saving
- 万字手撕七大排序(代码+动图演示)
- 编程思想比任何都重要,不是比谁多会用几个函数而是比程序的理解
- Pymssql controls SQL for Chinese queries
- Mysql database underlying foundation column
- 没有多少人能够最终把自己的兴趣带到大学毕业上
- uniapp 实现微信小程序全局分享及自定义分享按钮样式
- 4G module IMEI of charging pile design
- yocto 技術分享第四期:自定義增加軟件包支持
- openEuler kernel 技术分享 - 第1期 - kdump 基本原理、使用及案例介绍
猜你喜欢
![[combinatorics] Introduction to Combinatorics (combinatorial idea 3: upper and lower bound approximation | upper and lower bound approximation example Remsey number)](/img/19/5dc152b3fadeb56de50768561ad659.jpg)
[combinatorics] Introduction to Combinatorics (combinatorial idea 3: upper and lower bound approximation | upper and lower bound approximation example Remsey number)

The third paper of information system project manager in soft examination

CEF download, compile project

Mysql database underlying foundation column

干单片机这一行的时候根本没想过这么多,只想着先挣钱养活自己

Basic knowledge of communication interface

Pymssql controls SQL for Chinese queries

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

Yocto technology sharing phase IV: customize and add software package support

Working mode of 80C51 Serial Port
随机推荐
STM32 general timer 1s delay to realize LED flashing
Stm32 NVIC interrupt priority management
Education is a pass and ticket. With it, you can step into a higher-level environment
01仿B站项目业务架构
There is no specific definition of embedded system
JS基础-原型原型链和宏任务/微任务/事件机制
Timer and counter of 51 single chip microcomputer
Not many people can finally bring their interests to college graduation
【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
Toolbutton property settings
Runtime. getRuntime(). GC () and runtime getRuntime(). The difference between runfinalization()
Pymssql controls SQL for Chinese queries
(1) 什么是Lambda表达式
03 FastJson 解决循环引用
Positive and negative sample division and architecture understanding in image classification and target detection
The third paper of information system project manager in soft examination
01 business structure of imitation station B project
Basic knowledge of communication interface
Screen display of charging pile design -- led driver ta6932
Sending and interrupt receiving of STM32 serial port