Nepomuk
Nepomuk::TagWidget Class Reference
Allows to change a selection of tags. More...
#include <Nepomuk/TagWidget>

Public Types | |
| enum | ModeFlag { MiniMode = 0x1, StandardMode = 0x2, ReadOnly = 0x4, DisableTagClicking = 0x8 } |
Public Slots | |
| void | setAlignment (Qt::Alignment alignment) |
| void | setAssignedTags (const QList< Nepomuk::Tag > &tags) |
| void | setMaxTagsShown (int max) |
| void | setModeFlags (ModeFlags flags) |
| void | setSelectedTags (const QList< Nepomuk::Tag > &tags) |
| void | setTaggedResource (const Resource &resource) |
| void | setTaggedResources (const QList< Resource > &resources) |
Signals | |
| void | selectionChanged (const QList< Nepomuk::Tag > &tags) |
| void | tagClicked (Nepomuk::Tag) |
Public Member Functions | |
| TagWidget (const Resource &resource, QWidget *parent=0) | |
| TagWidget (QWidget *parent=0) | |
| ~TagWidget () | |
| Qt::Alignment | alignment () const |
| QList< Tag > | assignedTags () const |
| int | maxTagsShown () const |
| ModeFlags | modeFlags () const |
| QList< Nepomuk::Tag > | selectedTags () const |
| QList< Resource > | taggedResources () const |
Detailed Description
Allows to change a selection of tags.
TagWidget provides a simple GUI interface to assign tags. It has two basic modes:
- If resources are set via setTaggedResource() or setTaggedResources() the changes in the tag selection are automatically assigned to the selected resources.
- If no resources have been set the widget simply emits the selectionChanged() signal.
Definition at line 48 of file tagwidget.h.
Member Enumeration Documentation
Flags to configure the widget.
- Since:
- 4.5
- Enumerator:
MiniMode The mini mode which tries to display the tags on the least space possible.
StandardMode The standard mode which is used by default provides a set of check boxes for the most frequently used tags.
ReadOnly Read only mode which prevents the changing of tags by the user.
DisableTagClicking Disable the clicking of the tags.
This will also disable the emitting of the tagClicked() signal.
Definition at line 119 of file tagwidget.h.
Constructor & Destructor Documentation
Creates a new TagWidget for resource.
The assigned tags are loaded instantly.
| Nepomuk::TagWidget::TagWidget | ( | QWidget * | parent = 0 | ) |
Constructor.
| Nepomuk::TagWidget::~TagWidget | ( | ) |
Destructor.
Member Function Documentation
| Qt::Alignment Nepomuk::TagWidget::alignment | ( | ) | const |
The alignment of the tags in the widget.
- Since:
- 4.5
| QList<Tag> Nepomuk::TagWidget::assignedTags | ( | ) | const |
- Deprecated:
- use selectedTags() instead
| int Nepomuk::TagWidget::maxTagsShown | ( | ) | const |
By default the TagWidget shows the most often used tags in the main window and allows access to all tags via an additional button.
This is the maximum number of tags that should be shown unless they are selected.
- See also:
- setMaxTagsShown()
- Since:
- 4.5
| ModeFlags Nepomuk::TagWidget::modeFlags | ( | ) | const |
| QList<Nepomuk::Tag> Nepomuk::TagWidget::selectedTags | ( | ) | const |
The list of selected tags.
- Returns:
- The list of all tags that are currently selected. In case resources to be tagged have been selected this list matches the tags assigned to the resources.
- See also:
- setTaggedResource, taggedResource, Resource::getTags
- Since:
- 4.5
| void Nepomuk::TagWidget::selectionChanged | ( | const QList< Nepomuk::Tag > & | tags | ) | [signal] |
Emitted whenever the selection of tags changes.
- Since:
- 4.5
| void Nepomuk::TagWidget::setAlignment | ( | Qt::Alignment | alignment | ) | [slot] |
Set the alignment to use.
Only horizontal alignment flags make a difference.
- Since:
- 4.5
| void Nepomuk::TagWidget::setAssignedTags | ( | const QList< Nepomuk::Tag > & | tags | ) | [slot] |
- Deprecated:
- use setSelectedTags() instead
| void Nepomuk::TagWidget::setMaxTagsShown | ( | int | max | ) | [slot] |
By default the TagWidget shows the most often used tags in the main window and allows access to all tags via an additional button.
The number of tags that are shown by default can be changed.
- Parameters:
-
max The maximum number of tags that should be shown in the main window. Set to 0 for no limit. Be aware that more tags might be shown since selected tags are always shown.
- Since:
- 4.5
| void Nepomuk::TagWidget::setModeFlags | ( | ModeFlags | flags | ) | [slot] |
Set flags to change the behaviour and look of the tag widget.
- Since:
- 4.5
| void Nepomuk::TagWidget::setSelectedTags | ( | const QList< Nepomuk::Tag > & | tags | ) | [slot] |
Set the list of selected tags.
In case resources have been set via setTaggedResource() or setTaggedResources() their list of tags is changed automatically.
- Since:
- 4.5
| void Nepomuk::TagWidget::setTaggedResource | ( | const Resource & | resource | ) | [slot] |
Set the Resource to be tagged.
The assigned tags will be loaded instantly.
| void Nepomuk::TagWidget::setTaggedResources | ( | const QList< Resource > & | resources | ) | [slot] |
Set the resources to be tagged.
If the list of resources is empty TagWidget will only emit the selectionChanged() signal.
| void Nepomuk::TagWidget::tagClicked | ( | Nepomuk::Tag | ) | [signal] |
This signal is emitted whenever a tag is clicked.
| QList<Resource> Nepomuk::TagWidget::taggedResources | ( | ) | const |
- Returns:
- The resources that are supposed to be tagged or an empty list if none have been set.
The documentation for this class was generated from the following file:
KDE 4.6 API Reference