当前位置:网站首页>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
边栏推荐
- Getting started with JMX, MBean, mxbean, mbeanserver
- Problems encountered when MySQL saves CSV files
- Yocto technology sharing phase IV: customize and add software package support
- Interruption system of 51 single chip microcomputer
- QT self drawing button with bubbles
- 4G module IMEI of charging pile design
- 使用sed替换文件夹下文件
- Which language should I choose to program for single chip microcomputer
- 当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学
- Oracle database SQL statement execution plan, statement tracking and optimization instance
猜你喜欢

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

CEF download, compile project

Comment la base de données mémoire joue - t - elle l'avantage de la mémoire?

There is no specific definition of embedded system

The third paper of information system project manager in soft examination

ADS simulation design of class AB RF power amplifier

Installation and removal of MySQL under Windows

新系列单片机还延续了STM32产品家族的低电压和节能两大优势

JS foundation - prototype prototype chain and macro task / micro task / event mechanism

对于新入行的同学,如果你完全没有接触单片机,建议51单片机入门
随机推荐
内存数据库究竟是如何发挥内存优势的?
Yocto Technology Sharing Phase 4: Custom add package support
YOLO_ V1 summary
Which language should I choose to program for single chip microcomputer
Do you understand automatic packing and unpacking? What is the principle?
万字手撕七大排序(代码+动图演示)
There is no shortcut to learning and development, and there is almost no situation that you can learn faster by leading the way
Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
Liquid crystal display
QT is a method of batch modifying the style of a certain type of control after naming the control
【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
In third tier cities and counties, it is difficult to get 10K after graduation
2. Elment UI date selector formatting problem
You need to use MySQL in the opening experiment. How can you forget the basic select statement? Remedy is coming~
应用最广泛的8位单片机当然也是初学者们最容易上手学习的单片机
Development of intelligent charging pile (I): overview of the overall design of the system
內存數據庫究竟是如何發揮內存優勢的?
An executable binary file contains more than machine instructions
2021-10-28
STM32 general timer 1s delay to realize LED flashing