pub struct QRCode<'a, Theme = Theme>where
Theme: Catalog,{ /* private fields */ }Available on crate feature
qr_code only.Expand description
A type of matrix barcode consisting of squares arranged in a grid which can be read by an imaging device, such as a camera.
§Example
use iced::widget::qr_code;
struct State {
data: qr_code::Data,
}
#[derive(Debug, Clone)]
enum Message {
// ...
}
fn view(state: &State) -> Element<'_, Message> {
qr_code(&state.data).into()
}Implementations§
Source§impl<'a, Theme> QRCode<'a, Theme>where
Theme: Catalog,
impl<'a, Theme> QRCode<'a, Theme>where
Theme: Catalog,
Sourcepub fn cell_size(self, cell_size: impl Into<Pixels>) -> Self
pub fn cell_size(self, cell_size: impl Into<Pixels>) -> Self
Sets the size of the squares of the grid cell of the QRCode.
Sourcepub fn total_size(self, total_size: impl Into<Pixels>) -> Self
pub fn total_size(self, total_size: impl Into<Pixels>) -> Self
Sets the size of the entire QRCode.
Trait Implementations§
Source§impl<'a, Message, Theme> From<QRCode<'a, Theme>> for Element<'a, Message, Theme, Renderer>where
Theme: Catalog + 'a,
impl<'a, Message, Theme> From<QRCode<'a, Theme>> for Element<'a, Message, Theme, Renderer>where
Theme: Catalog + 'a,
Source§impl<Message, Theme> Widget<Message, Theme, Renderer> for QRCode<'_, Theme>where
Theme: Catalog,
impl<Message, Theme> Widget<Message, Theme, Renderer> for QRCode<'_, Theme>where
Theme: Catalog,
Source§fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer,
theme: &Theme,
_style: &Style,
layout: Layout<'_>,
_cursor: Cursor,
_viewport: &Rectangle,
)
fn draw( &self, tree: &Tree, renderer: &mut Renderer, theme: &Theme, _style: &Style, layout: Layout<'_>, _cursor: Cursor, _viewport: &Rectangle, )
Draws the
Widget using the associated Renderer.Source§fn operate(
&mut self,
_tree: &mut Tree,
layout: Layout<'_>,
_renderer: &Renderer,
operation: &mut dyn Operation,
)
fn operate( &mut self, _tree: &mut Tree, layout: Layout<'_>, _renderer: &Renderer, operation: &mut dyn Operation, )
Source§fn update(
&mut self,
_tree: &mut Tree,
_event: &Event,
_layout: Layout<'_>,
_cursor: Cursor,
_renderer: &Renderer,
_shell: &mut Shell<'_, Message>,
_viewport: &Rectangle,
)
fn update( &mut self, _tree: &mut Tree, _event: &Event, _layout: Layout<'_>, _cursor: Cursor, _renderer: &Renderer, _shell: &mut Shell<'_, Message>, _viewport: &Rectangle, )
Source§fn mouse_interaction(
&self,
_tree: &Tree,
_layout: Layout<'_>,
_cursor: Cursor,
_viewport: &Rectangle,
_renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, _tree: &Tree, _layout: Layout<'_>, _cursor: Cursor, _viewport: &Rectangle, _renderer: &Renderer, ) -> Interaction
Auto Trait Implementations§
impl<'a, Theme> Freeze for QRCode<'a, Theme>
impl<'a, Theme = Theme> !RefUnwindSafe for QRCode<'a, Theme>
impl<'a, Theme = Theme> !Send for QRCode<'a, Theme>
impl<'a, Theme = Theme> !Sync for QRCode<'a, Theme>
impl<'a, Theme> Unpin for QRCode<'a, Theme>
impl<'a, Theme> UnsafeUnpin for QRCode<'a, Theme>
impl<'a, Theme = Theme> !UnwindSafe for QRCode<'a, Theme>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more