当前位置:网站首页>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
边栏推荐
- Happy Dragon Boat Festival—— Zongzi written by canvas~~~~~
- Emballage automatique et déballage compris? Quel est le principe?
- Drive and control program of Dianchuan charging board for charging pile design
- 干单片机这一行的时候根本没想过这么多,只想着先挣钱养活自己
- Which language should I choose to program for single chip microcomputer
- Stm32f407 key interrupt
- There is no specific definition of embedded system
- 4G module initialization of charge point design
- Swing transformer details-1
- byte alignment
猜你喜欢

Blue Bridge Cup for migrant workers majoring in electronic information engineering

LeetCode - 673. 最长递增子序列的个数

Quelle langue choisir pour programmer un micro - ordinateur à puce unique

STM32 interrupt switch

My notes on intelligent charging pile development (II): overview of system hardware circuit design

2.Elment Ui 日期选择器 格式化问题

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

openEuler kernel 技術分享 - 第1期 - kdump 基本原理、使用及案例介紹

Project cost management__ Topic of comprehensive calculation

Getting started with JMX, MBean, mxbean, mbeanserver
随机推荐
[combinatorics] Introduction to Combinatorics (combinatorial idea 3: upper and lower bound approximation | upper and lower bound approximation example Remsey number)
Which language should I choose to program for single chip microcomputer
Introduction to chromium embedded framework (CEF)
Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip
STM32 interrupt switch
2312、卖木头块 | 面试官与狂徒张三的那些事(leetcode,附思维导图 + 全部解法)
4G module at command communication package interface designed by charging pile
[Li Kou brush question notes (II)] special skills, module breakthroughs, classification and summary of 45 classic questions, and refinement in continuous consolidation
[untitled] proteus simulation of traffic lights based on 89C51 Single Chip Microcomputer
嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
It is difficult to quantify the extent to which a single-chip computer can find a job
Interruption system of 51 single chip microcomputer
內存數據庫究竟是如何發揮內存優勢的?
2021-10-28
Assignment to '*' form incompatible pointer type 'linkstack' {aka '*'} problem solving
单片机学到什么程度能找到工作,这个标准不好量化
Leetcode 300 最长上升子序列
当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学
Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
An executable binary file contains more than machine instructions