GnomeQRGtk.Widget¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (18), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (7), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/c/en |
|||
r/w/c/en |
|||
r/w/c/en |
|||
r/w/c/en |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Emitted when the QR code texture has been regenerated. |
Fields¶
- Inherited:
Class Details¶
- class GnomeQRGtk.Widget(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
GnomeQrWidgetwidget displays a rendered QR Code.- CSS nodes
GnomeQrWidgethas a single CSS node with the namegnome-qr-code. It can be themed using thecolorandbackground-colorproperties.- Accessibility
GnomeQrWidgetuses theGTK_ACCESSIBLE_ROLE_IMGrole.- classmethod new(text)¶
- Parameters:
- Returns:
a new
GnomeQRGtk.Widget- Return type:
Creates a new
GnomeQRGtk.Widget.
- get_alternative_text()¶
-
Gets the alternative textual description of the QR code.
The returned string will be
Noneif the qr code cannot be described textually.
- get_ecc_level()¶
- Returns:
the error correction level
- Return type:
Gets the current error correction level of the QR code.
- get_size()¶
- Returns:
the size in pixels
- Return type:
Gets the current natural size of the widget.
- get_text()¶
-
Gets the text currently encoded in the QR code.
- set_alternative_text(alternative_text)¶
-
Sets an alternative textual description for the QR Code contents.
It is equivalent to the “alt” attribute for images on websites.
This text will be made available to accessibility tools.
If the QR code cannot be described textually, set this property to
None.By default, this is set to “QR Code”.
- set_ecc_level(ecc)¶
- Parameters:
ecc (
GnomeQR.EccLevel) – the error correction level
Sets the error correction level for the QR code.
Higher error correction levels provide better recovery from damage or obscured areas, but result in larger QR codes with more modules.
- set_size(size)¶
- Parameters:
size (
int) – the size in pixels for the widget’s natural and minimum size
Sets the natural and minimum size (width and height) of the widget.
The QR code will be rendered to fit within this size while maintaining its aspect ratio (square).
If the size is smaller than the minimum size of the QR code, it will be ignored and the QR code will be rendered at its minimum size (1 pixel per block).
Signal Details¶
- GnomeQRGtk.Widget.signals.changed(widget)¶
- Signal Name:
changed- Flags:
- Parameters:
widget (
GnomeQRGtk.Widget) – The object which received the signal
Emitted when the QR code texture has been regenerated.
This signal is emitted after the widget’s text or error correction level changes and the new QR code has been successfully generated.
Property Details¶
- GnomeQRGtk.Widget.props.alternative_text¶
- Name:
alternative-text- Type:
- Default Value:
'QR Code'- Flags:
- GnomeQRGtk.Widget.props.ecc_level¶
- Name:
ecc-level- Type:
- Default Value:
- Flags:
- GnomeQRGtk.Widget.props.size¶
- Name:
size- Type:
- Default Value:
0- Flags: