Skip to content

EAvatar Avatar ​

import EUI 1.0

Examples ​

Icon avatars, custom fallback and fitting ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Avatar ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Properties ​

PropertyDescriptionValues and default
altstring

Alternative text when the avatar source cannot load.

Default""
backgroundColorcolor

Background color.

DefaultDynamic binding
contentalias

Content slot; declare QML child objects directly inside the component.

DefaultAlias: fallbackContent.data
enabledbool

Allow interaction; false disables the control.

Defaulttrue
fillModeint

How the avatar image scales and fills its available space.

Image.Stretch
Image.PreserveAspectFit
Image.PreserveAspectCrop

DefaultImage.PreserveAspectCrop
heightreal

Component size in pixels; may be bound to its parent layout.

DefaultimplicitHeight
iconSourceint

Icon used by the component.

EIcons.*
0 (no icon)

Default0
shapestring

Avatar shape.

circle
square

Default"circle"
sizeint

Avatar diameter or side length in pixels.

Default40
sourceurl

Image or media resource URL supported by Qt.

Default""
srcsetstring

Alternative avatar sources used to choose an image resource.

Default""
textstring

Displayed text.

Default""
visiblebool

Whether the component is visible.

Defaulttrue
widthreal

Component size in pixels; may be bound to its parent layout.

DefaultimplicitWidth
effectiveSourceurlRead only

Actual avatar URL resolved from source and srcset.

DefaultComputed at runtime
loadedboolRead only

Whether the avatar image has loaded successfully.

DefaultComputed at runtime

Signals ​

SignaturePurpose
loadError()

Emitted when the image fails to load; use it to show fallback content.

Released under the MIT License. Third-party assets retain their own licenses.