QRcode with lv_bindings_micropython

I try add the QRcode widgets to micropython bindings, but faild…

I checked the source code of qrcode lib and found that its structure is different from other widgets.

QR code

lv_obj_t * lv_qrcode_create(lv_obj_t * parent, lv_coord_t size, lv_color_t dark_color, lv_color_t light_color);

arc

lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy);

And gen_mpy.py only automatically generates three APIs related to qrcode when I include the “lv_qrcode.h” file.

How to add this qrcode widgets? :cry:

Hi @imliubo
LVGL Micropython bindings expects specific conventions from the C API.
One of the conventions is a specific prototype for a constructor, as you noticed.

Apparently the QRCode external component does not follow LVGL conventions.

I can suggest:

  • Openning an issue on the QRCode GitHub repo and report this problem
  • Creating a new version of the QRCode component with LVGL conventions
  • Or wrapping the exiting QRCode component with a new C API that follows LVGL conventions and use that for Micropython