Skip to content

Allow to remove QR code #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion adafruit_portalbase/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,19 @@ def qrcode(
): # pylint: disable=invalid-name
"""Display a QR code

:param qr_data: The data for the QR code.
:param qr_data: The data for the QR code, None to remove.
:param int qr_size: The scale of the QR code.
:param x: The x position of upper left corner of the QR code on the display.
:param y: The y position of upper left corner of the QR code on the display.

"""
if qr_data is None:
if self._qr_group and self._qr_group in self.splash:
self.splash.remove(self._qr_group)
self._qr_group = None
gc.collect()
return

import adafruit_miniqr # pylint: disable=import-outside-toplevel

# generate the QR code
Expand Down