org::kde::kirigami::Avatar

Search for usage in LXR

org::kde::kirigami::Avatar Class Reference
Inheritance diagram for org::kde::kirigami::Avatar:

Public Types

enum  ImageMode { AlwaysShowImage, AdaptiveImageOrInitals, AlwaysShowInitials }
 
enum  InitialsMode { UseInitials, UseIcon }
 

Properties

KP AvatarGroup
 
TP BorderPropertiesGroup
 
alias cache
 
var color
 
alias iconSource
 
int imageMode
 
int initialsMode
 
string name
 
alias smooth
 
alias source
 
alias sourceSize
 

Public Member Functions

void __triggerMainAction ()
 

Detailed Description

An element that represents a user, either with initials, an icon, or a profile image.

Definition at line 18 of file Avatar.qml.

Property Documentation

◆ AvatarGroup

KP org::kde::kirigami::Avatar::AvatarGroup
read

This property holds the main and secondary actions associated with this avatar.

Kirigami.Avatar {
actions.main: Kirigami.Action {}
actions.secondary: Kirigami.Action {}
}

Actions associated with this avatar.

Note
The secondary action should only be used for shortcuts of actions elsewhere in your application's UI, and cannot be accessed on mobile platforms.

Definition at line 119 of file Avatar.qml.

◆ BorderPropertiesGroup

TP org::kde::kirigami::Avatar::BorderPropertiesGroup
read

This property holds the border properties group.

Kirigami.Avatar {
border.width: 10
border.color: 'red'
}

Definition at line 129 of file Avatar.qml.

◆ cache

bool org::kde::kirigami::Avatar::cache
read

This property sets whether the provided image should be cached.

See also
QtQuick.Image::cache

Definition at line 82 of file Avatar.qml.

◆ color

color org::kde::kirigami::Avatar::color
read

This property holds the color to use for this avatar.

If not explicitly set, this defaults to generating a color from the name.

Definition at line 102 of file Avatar.qml.

◆ iconSource

var org::kde::kirigami::Avatar::iconSource
read

This property holds avatar's icon source.

This icon is displayed when using an icon with Avatar.InitialsMode.UseIcon and Avatar.ImageNode.AlwaysShowInitials enabled.

See also
org::kde::kirigami::Icon::source

Definition at line 52 of file Avatar.qml.

◆ imageMode

int org::kde::kirigami::Avatar::imageMode
read

This property holds how the avatar should be shown.

This property holds whether the button should always show the image; show the image if one is available and show initials when it is not; or always show initials.

Possible values are:

  • Avatar.ImageMode.AlwaysShowImage: Always try to show the image; even if it hasn't loaded yet or is undefined.
  • Avatar.ImageMode.AdaptiveImageOrInitals: Show the image if it is valid; or show initials if it is not
  • Avatar.ImageMode.AlwaysShowInitials: Always show initials
See also
org::kde::kirigami::Avatar::ImageMode

Definition at line 76 of file Avatar.qml.

◆ initialsMode

int org::kde::kirigami::Avatar::initialsMode
read

This property holds how the button should represent the user when no user-set image is available.

Possible values are:

  • Avatar.InitialsMode.UseInitials: Show the user's initials.
  • Avatar.InitialsMode.UseIcon: Show a generic icon.
See also
org::kde::kirigami::Avatar::InitialsMode

Definition at line 62 of file Avatar.qml.

◆ name

string org::kde::kirigami::Avatar::name
read

This property holds the given name of a user.

The user's name will be used for generating initials and to provide the accessible name for assistive technology.

Definition at line 36 of file Avatar.qml.

◆ smooth

bool org::kde::kirigami::Avatar::smooth
read

This property holds whether the provided image should be smoothed.

See also
QtQuick.Image::smooth

Definition at line 94 of file Avatar.qml.

◆ source

url org::kde::kirigami::Avatar::source
read

This property holds the source of the user's profile picture; an image.

See also
QtQuick.Image::source

Definition at line 42 of file Avatar.qml.

◆ sourceSize

int org::kde::kirigami::Avatar::sourceSize
read

This property holds the source size of the user's profile picture.

See also
QtQuick.Image::sourceSize

Definition at line 88 of file Avatar.qml.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 04:13:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.