summaryrefslogtreecommitdiffstats
path: root/widget/src/helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'widget/src/helpers.rs')
-rw-r--r--widget/src/helpers.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs
index 400fced5..6ae35aee 100644
--- a/widget/src/helpers.rs
+++ b/widget/src/helpers.rs
@@ -387,6 +387,18 @@ where
crate::Canvas::new(program)
}
+/// Creates a new [`QRCode`] widget from the given [`Data`].
+///
+/// [`Svg`]: crate::QRCode
+/// [`Data`]: crate::qr_code::Data
+#[cfg(feature = "qr_code")]
+pub fn qr_code<Theme>(data: &crate::qr_code::Data) -> crate::QRCode<'_, Theme>
+where
+ Theme: crate::qr_code::StyleSheet,
+{
+ crate::QRCode::new(data)
+}
+
/// Creates a new [`Shader`].
///
/// [`Shader`]: crate::Shader