当前位置:网站首页>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
边栏推荐
- Uniapp realizes global sharing of wechat applet and custom sharing button style
- Comment la base de données mémoire joue - t - elle l'avantage de la mémoire?
- Notes on C language learning of migrant workers majoring in electronic information engineering
- Blue Bridge Cup for migrant workers majoring in electronic information engineering
- 单片机学到什么程度能找到工作,这个标准不好量化
- 2020-08-23
- Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
- El table X-axis direction (horizontal) scroll bar slides to the right by default
- Not many people can finally bring their interests to college graduation
- STM32 running lantern experiment - library function version
猜你喜欢
嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
Leetcode 300 最长上升子序列
CEF download, compile project
内存数据库究竟是如何发挥内存优势的?
The new series of MCU also continues the two advantages of STM32 product family: low voltage and energy saving
Not many people can finally bring their interests to college graduation
2021-10-28
Installation and removal of MySQL under Windows
LeetCode - 460 LFU 缓存(设计 - 哈希表+双向链表 哈希表+平衡二叉树(TreeSet))*
一个可执行的二进制文件包含的不仅仅是机器指令
随机推荐
The data read by pandas is saved to the MySQL database
ADS simulation design of class AB RF power amplifier
My notes on intelligent charging pile development (II): overview of system hardware circuit design
2020-08-23
嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
QT is a method of batch modifying the style of a certain type of control after naming the control
There is no specific definition of embedded system
4G module initialization of charge point design
干单片机这一行的时候根本没想过这么多,只想着先挣钱养活自己
Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
01 business structure of imitation station B project
Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
2020-08-23
Project cost management__ Topic of comprehensive calculation
要选择那种语言为单片机编写程序呢
There is no shortcut to learning and development, and there is almost no situation that you can learn faster by leading the way
Screen display of charging pile design -- led driver ta6932
The new series of MCU also continues the two advantages of STM32 product family: low voltage and energy saving
Quelle langue choisir pour programmer un micro - ordinateur à puce unique
Simple use of MySQL (addition, deletion, modification and query)