1 Star 0 Fork 15

sspemail/LVGLBuilder

forked from zhangheyang/LVGLBuilder 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
LVGLTabWidget.cpp 901 Bytes
一键复制 编辑 原始数据 按行查看 历史
#include "LVGLTabWidget.h"
#include <QGridLayout>
#include "LVGLObject.h"
#include "LVGLSimulator.h"
LVGLTabWidget::LVGLTabWidget(QWidget *parent)
: QWidget(parent), m_parent(lv_obj_create(NULL, NULL)) {}
void LVGLTabWidget::setSimulator(LVGLSimulator *sim) {
delete this->layout();
QGridLayout *glayout = new QGridLayout(this);
glayout->addWidget(sim, 0, 0, 1, 1);
}
void LVGLTabWidget::removeObject(LVGLObject *object) {
auto childs = object->childs();
while (!childs.isEmpty()) {
removeObject(childs.at(0));
childs = object->childs();
}
if (object->parent()) object->parent()->removeChild(object);
m_objects.removeOne(object);
delete object;
object = nullptr;
}
void LVGLTabWidget::removeAllObjects() {
auto objs = m_objects;
while (!objs.isEmpty()) {
if (objs.at(0) && !objs.at(0)->parent()) removeObject(m_objects.at(0));
objs = m_objects;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sspemail/LVGLBuilder.git
git@gitee.com:sspemail/LVGLBuilder.git
sspemail
LVGLBuilder
LVGLBuilder
master

搜索帮助