# lv_qrcode.h (/api/libs/qrcode/lv_qrcode_h)



<RelatedHeaders name="lv_qrcode_private.h" isPrivate="false" />

<ApiSummary functions="7" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (5)&#x22;,&#x22;Other (2)&#x22;]">
  <ApiTab value="Setters (5)">
    <ApiMember kind="function" name="lv_qrcode_set_size" file="libs/qrcode/lv_qrcode.h" line="50" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/qrcode/lv_qrcode.h#L50">
      lv_qrcode_set_size [#lv_qrcode_set_size]

      Set QR code size.

      ```c title=" " lineNumbers=1
      void lv_qrcode_set_size(lv_obj_t *obj, int32_t size)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                     |
      | ------ | ------------------------------------------------ | ------------------------------- |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a QR code object     |
      | `size` | <ApiLink name="int32_t" />                       | width and height of the QR code |
    </ApiMember>

    <ApiMember kind="function" name="lv_qrcode_set_dark_color" file="libs/qrcode/lv_qrcode.h" line="57" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/qrcode/lv_qrcode.h#L57">
      lv_qrcode_set_dark_color [#lv_qrcode_set_dark_color]

      Set QR code dark color.

      ```c title=" " lineNumbers=1
      void lv_qrcode_set_dark_color(lv_obj_t *obj, lv_color_t color)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                 |
      | ------- | ------------------------------------------------ | --------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a QR code object |
      | `color` | <ApiLink name="lv_color_t" />                    | dark color of the QR code   |
    </ApiMember>

    <ApiMember kind="function" name="lv_qrcode_set_light_color" file="libs/qrcode/lv_qrcode.h" line="64" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/qrcode/lv_qrcode.h#L64">
      lv_qrcode_set_light_color [#lv_qrcode_set_light_color]

      Set QR code light color.

      ```c title=" " lineNumbers=1
      void lv_qrcode_set_light_color(lv_obj_t *obj, lv_color_t color)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                 |
      | ------- | ------------------------------------------------ | --------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a QR code object |
      | `color` | <ApiLink name="lv_color_t" />                    | light color of the QR code  |
    </ApiMember>

    <ApiMember kind="function" name="lv_qrcode_set_data" file="libs/qrcode/lv_qrcode.h" line="80" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/qrcode/lv_qrcode.h#L80">
      lv_qrcode_set_data [#lv_qrcode_set_data]

      Helper function to set the data of a QR code object

      ```c title=" " lineNumbers=1
      void lv_qrcode_set_data(lv_obj_t *obj, const char *data)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                 |
      | ------ | ------------------------------------------------ | --------------------------- |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a QR code object |
      | `data` | `const char *`                                   | data to display as a string |
    </ApiMember>

    <ApiMember kind="function" name="lv_qrcode_set_quiet_zone" file="libs/qrcode/lv_qrcode.h" line="88" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/qrcode/lv_qrcode.h#L88">
      lv_qrcode_set_quiet_zone [#lv_qrcode_set_quiet_zone]

      Enable or disable quiet zone. Quiet zone is the area around the QR code where no data is encoded.

      ```c title=" " lineNumbers=1
      void lv_qrcode_set_quiet_zone(lv_obj_t *obj, bool enable)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                        |
      | -------- | ------------------------------------------------ | -------------------------------------------------- |
      | `obj`    | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a QR code object                        |
      | `enable` | <ApiLink name="bool" />                          | true: enable quiet zone; false: disable quiet zone |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (2)">
    <ApiMember kind="function" name="lv_qrcode_create" file="libs/qrcode/lv_qrcode.h" line="43" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/qrcode/lv_qrcode.h#L43">
      lv_qrcode_create [#lv_qrcode_create]

      Create an empty QR code (an `lv_canvas`) object.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_qrcode_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                    |
      | -------- | ------------------------------------------------ | ---------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | point to an object where to create the QR code |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created QR code object
    </ApiMember>

    <ApiMember kind="function" name="lv_qrcode_update" file="libs/qrcode/lv_qrcode.h" line="73" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/qrcode/lv_qrcode.h#L73">
      lv_qrcode_update [#lv_qrcode_update]

      Set the data of a QR code object

      ```c title=" " lineNumbers=1
      lv_result_t lv_qrcode_update(lv_obj_t *obj, const void *data, uint32_t data_len)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                             | Description                 |
      | ---------- | ------------------------------------------------ | --------------------------- |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a QR code object |
      | `data`     | `const void *`                                   | data to display             |
      | `data_len` | <ApiLink name="uint32_t" />                      | length of data in bytes     |

      **Returns:** <ApiLink name="lv_result_t" /> — LV\_RESULT\_OK: if no error; LV\_RESULT\_INVALID: on error
    </ApiMember>
  </ApiTab>
</ApiTabs>

Variables [#variables]

<ApiMember kind="variable" name="lv_qrcode_class" file="libs/qrcode/lv_qrcode.h" line="32" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/qrcode/lv_qrcode.h#L32">
  lv_qrcode_class [#lv_qrcode_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_qrcode_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_types.h&#x22;, &#x22;lv_canvas.h&#x22;, &#x22;stdbool.h&#x22;, &#x22;stdint.h&#x22;]" includedBy="[&#x22;lv_qrcode_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_observer.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;]" />
