1 Star 0 Fork 15

adewei/LVGLBuilder

forked from zhangheyang/LVGLBuilder 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
LVGLObject.h 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
CURTLab 提交于 2020-11-08 19:27 . Fixes for 2 value property
#ifndef LVGLOBJECT_H
#define LVGLOBJECT_H
#include <QObject>
#include <QJsonObject>
#include <lvgl/lvgl.h>
#include "widgets/LVGLWidget.h"
class LVGLObject : public QObject
{
Q_OBJECT
public:
LVGLObject(const LVGLWidget *widgetClass, QString name, LVGLObject *parent);
LVGLObject(const LVGLWidget *widgetClass, QString name, lv_obj_t *parent);
LVGLObject(const LVGLWidget *widgetClass, LVGLObject *parent, lv_obj_t *parentObj);
LVGLObject(lv_obj_t *obj, const LVGLWidget *widgetClass, LVGLObject *parent, bool movable = true, int index = -1);
~LVGLObject();
lv_obj_t *obj() const;
QString name() const;
void setName(const QString &name);
QString codeName() const;
bool isLocked() const;
void setLocked(bool locked);
bool isMovable() const;
const LVGLWidget *widgetClass() const;
LVGLWidget::Type widgetType() const;
QPoint absolutePosition() const;
QPoint position() const;
int x() const;
int y() const;
void setPosition(const QPoint &pos);
void setX(int x);
void setY(int y);
QSize size() const;
QRect geometry() const;
void setGeometry(QRect geometry);
int width() const;
int height() const;
void setWidth(int width);
void setHeight(int height);
QJsonObject toJson();
QJsonArray jsonStyles() const;
QStringList codeStyle(QString styleVar, int type) const;
void parseStyles(const QJsonArray &styles);
LVGLObject *parent() const;
operator lv_obj_t *() noexcept;
operator const lv_obj_t *() const noexcept;
bool hasCustomStyle(int type) const;
lv_style_t *style(int type);
QString styleCodeName(int type) const;
QList<LVGLObject *> childs() const;
void removeChild(LVGLObject *child);
bool isAccessible() const;
void setAccessible(bool accessible);
bool doesNameExists() const;
static bool doesNameExists(const QString &name, LVGLObject *except = nullptr);
void generateName();
static LVGLObject *parse(QJsonObject object, LVGLObject *parent);
int index() const;
LVGLObject *findChildByIndex(int index) const;
signals:
void positionChanged();
private:
lv_obj_t *m_obj;
const LVGLWidget *m_widgetClass;
QString m_name;
bool m_locked;
bool m_accessible;
bool m_movable;
int m_index;
LVGLObject *m_parent;
QList<LVGLObject*> m_childs;
QHash<int,lv_style_t> m_styles;
};
#endif // LVGLOBJECT_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/adewei/LVGLBuilder.git
git@gitee.com:adewei/LVGLBuilder.git
adewei
LVGLBuilder
LVGLBuilder
master

搜索帮助