TagsBar

Search for usage in LXR

Inheritance diagram for TagsBar:

Properties

bool allowEditMode
 
alias count
 
bool editMode
 
alias list
 
alias listView
 

Signals

void tagClicked (string tag)
 
void tagRemovedClicked (int index)
 
void tagsEdited (var tags)
 

Public Member Functions

void closeEditMode ()
 
void goEditMode ()
 
- 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 bar to list, add or remove tags for a given set of files.

See also
TagsList::urls
list

The retrieved file tags can be restricted to only tags created/associated by the app itself or by any app, this can be tweaked via the list.strict property.

See also
list
Example using TagsBar and FileBrowser controls
Maui.Page
{
id: _tagPreviewPage
Maui.Controls.showCSD: true
anchors.fill: parent
property var fileItem //A map object representing some properties from a file, such as its name, icon, url, etc.
Maui.Holder
{
anchors.fill: parent
emojiSize: 100
imageSource: _tagPreviewPage.fileItem.thumbnail
title: _tagPreviewPage.fileItem.name
}
footer: FB.TagsBar
{
list.strict: false
list.urls: [_tagPreviewPage.fileItem.url]
width: parent.width
onTagsEdited: (tags) => list.updateToUrls(tags)
}
}
}
alias list
To associate a one or a group of file URLs, use list.urls, or to disable the strict mode use list....
Definition TagsBar.qml:99

You can find a more complete example at this link.

Definition at line 64 of file TagsBar.qml.

Property Documentation

◆ allowEditMode

bool TagsBar::allowEditMode
read

Whether the bar exposes to the user the action buttons that allow to go into edit mode, or to remove the tag elements manually.

By default this is set to false

Definition at line 92 of file TagsBar.qml.

◆ count

alias TagsBar::count
read

The total amount of tag elements.

Remarks
This property is read-only

Definition at line 80 of file TagsBar.qml.

◆ editMode

bool TagsBar::editMode
read

Whether the bar should be in edit mode or not.

This can be also triggered by the user using the attached action buttons in the right side of the bar. In edit mode the bar exposes a text field, where all the tag elements are plain text divided by comma. The text can be edited to remove tags or add more.

See also
allowEditMode By default this is set to false.

Definition at line 87 of file TagsBar.qml.

◆ list

alias TagsBar::list
read

To associate a one or a group of file URLs, use list.urls, or to disable the strict mode use list.strict: false, etc. Read more about the available properties in the TagsListModel documentation page.

Remarks
This property is read-only
See also
TagList::list

Definition at line 99 of file TagsBar.qml.

◆ listView

alias TagsBar::listView
read

An alias to the flickable element listing the tag buttons.

Remarks
This property is read-only

It is exposed to fine tune more of this control properties.

Definition at line 74 of file TagsBar.qml.

Member Function Documentation

◆ closeEditMode()

void TagsBar::closeEditMode ( )

Force to exit the editing mode.

◆ goEditMode()

void TagsBar::goEditMode ( )

Force the bar to go into editing mode.

◆ tagClicked

void TagsBar::tagClicked ( string tag)
signal

Emitted when a tag element has been clicked.

Parameters
tagthe name of the tag element

◆ tagRemovedClicked

void TagsBar::tagRemovedClicked ( int index)
signal

Emitted when the close/dismiss button of a tag element has been clicked.

Parameters
indexthe index position of the tag element
Note
To retrieve information of the tag given the index position, use the alias property functionlist.get(index)

◆ tagsEdited

void TagsBar::tagsEdited ( var tags)
signal

Emitted when the tags have been manually edited by the user via the text field input.

Parameters
tagsthe list of tags entered in the text field.

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 Mon Nov 18 2024 12:10:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.