IconLabel

Search for usage in LXR

IconLabel Class Reference
Inheritance diagram for IconLabel:

Properties

alias alignment
 
int bottomPadding
 
alias color
 
int display
 
alias font
 
var icon
 
alias label
 
int leftPadding
 
int padding
 
int rightPadding
 
int spacing
 
alias text
 
int topPadding
 

Additional Inherited Members

- Public Member Functions inherited from QtQuick.Item
 childAt (real x, real y)
 
bool contains (point point)
 
 dumpItemTree ()
 
 forceActiveFocus ()
 
 forceActiveFocus (Qt::FocusReason reason)
 
bool grabToImage (callback, targetSize)
 
point mapFromGlobal (real x, real y)
 
point mapFromItem (Item item, point p)
 
point mapFromItem (Item item, real x, real y)
 
rect mapFromItem (Item item, real x, real y, real width, real height)
 
rect mapFromItem (Item item, rect r)
 
point mapToGlobal (real x, real y)
 
point mapToItem (Item item, point p)
 
point mapToItem (Item item, real x, real y)
 
rect mapToItem (Item item, real x, real y, real width, real height)
 
rect mapToItem (Item item, rect r)
 
 nextItemInFocusChain (bool forward)
 

Detailed Description

A icon and a label put together in two possible positions, a horizontal or vertical layout.

This control inherits from QQC2 Item, to checkout its inherited properties refer to the Qt Docs.

This is a base template for other controls, such as for setting the contents of the ToolButton, Button, MenuItem, etc, in the style.

Note
This control is only a visual item, and does not handle any event or gets any focus.
ColumnLayout
{
anchors.centerIn: parent
spacing: Maui.Style.space.big
Maui.IconLabel
{
icon: ({name: "folder", height: "22", width: "22", color: "yellow"})
text: "Testing"
display: ToolButton.TextBesideIcon
alignment: Qt.AlignLeft
color: "yellow"
}
Maui.IconLabel
{
icon: ({name: "vvave", height: "64", width: "64"})
text: "Vvave"
display: ToolButton.TextUnderIcon
}
}
A icon and a label put together in two possible positions, a horizontal or vertical layout.
Definition IconLabel.qml:71
alias alignment
The preferred horizontal alignment of the text.
var icon
This is a dictionary, which represents the properties for the icon.
int spacing
The spacing value between the icon element and the text label.
alias color
The color for the text.
Definition IconLabel.qml:82
int display
How to display the icon and the label.
alias text
The text to be used.
Definition IconLabel.qml:87
AlignHCenter
Warning
To set the icon properties, you need to set it as a dictionary map. The supported key values are:
  • name
  • source
  • color
  • height
  • width
  • cache
See also
icon

You can find a more complete example at this link.

Definition at line 71 of file IconLabel.qml.

Property Documentation

◆ alignment

enum IconLabel::alignment
read

The preferred horizontal alignment of the text.

By default this is set to Qt.AlignLeft.

Note
The alignment will depend on the width of the container. If there is a width bigger then the implicit width, then the alignment will be set as preferred.

Definition at line 124 of file IconLabel.qml.

◆ bottomPadding

int IconLabel::bottomPadding
read

Bottom padding.

By default this is set to padding

Definition at line 145 of file IconLabel.qml.

◆ color

color IconLabel::color
read

The color for the text.

By default this is set to Theme.textColor.

Note
to set the icon color, use the icon.color property.

Definition at line 82 of file IconLabel.qml.

◆ display

int IconLabel::display
read

How to display the icon and the label.

The available options are:

  • ToolButton.TextBesidesIcon
  • ToolButton.TextUnderIcon
  • ToolButton.TextOnly
  • ToolButton.IconOnly

By default this is set to ToolButton.IconOnly

Definition at line 117 of file IconLabel.qml.

◆ font

font IconLabel::font
read

The font properties of the text.

By default this is set to Style.defaultFont.

Definition at line 162 of file IconLabel.qml.

◆ icon

var IconLabel::icon
read

This is a dictionary, which represents the properties for the icon.

The supported key values are:

  • name
  • source
  • color
  • height
  • width
  • cache
Maui.IconLabel
{
icon: ({name: "folder", height: "22", width: "22", color: "yellow"})
}

Definition at line 106 of file IconLabel.qml.

◆ label

Label IconLabel::label
read

An alias tot he QQC2 Label handling the text.

Exposed for fine tuning the label properties.

Definition at line 168 of file IconLabel.qml.

◆ leftPadding

int IconLabel::leftPadding
read

Left padding.

By default this is set to padding

Definition at line 135 of file IconLabel.qml.

◆ padding

int IconLabel::padding
read

The total padding all around the element.

By default this is set to 0.

Definition at line 130 of file IconLabel.qml.

◆ rightPadding

int IconLabel::rightPadding
read

Right padding.

By default this is set to padding

Definition at line 140 of file IconLabel.qml.

◆ spacing

int IconLabel::spacing
read

The spacing value between the icon element and the text label.

By default this is set to Style.space.small.

See also
Style

Definition at line 156 of file IconLabel.qml.

◆ text

string IconLabel::text
read

The text to be used.

Definition at line 87 of file IconLabel.qml.

◆ topPadding

int IconLabel::topPadding
read

Top padding.

By default this is set to padding

Definition at line 150 of file IconLabel.qml.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.