2 Star 1 Fork 1

ssda/LVGLBuilder

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
LVGLTabWidget.cpp 901 Bytes
Copy Edit Raw Blame History
#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/shaoshunda/LVGLBuilder.git
git@gitee.com:shaoshunda/LVGLBuilder.git
shaoshunda
LVGLBuilder
LVGLBuilder
master

Search