TagsList

Search for usage in LXR

#include <tagslist.h>

Inheritance diagram for TagsList:

Properties

QML_ELEMENTbool strict
 
QStringList tags
 
QStringList urls
 
- Properties inherited from MauiList
QML_ANONYMOUSint count
 
- Properties inherited from QObject
 objectName
 

Signals

void strictChanged ()
 
void tagsChanged ()
 
void urlsChanged ()
 
- Signals inherited from MauiList
void countChanged ()
 
void itemMoved (int index, int to)
 
void postItemAppended ()
 
void postItemRemoved ()
 
void postListChanged ()
 
void preItemAppended ()
 
void preItemAppendedAt (int index)
 
void preItemRemoved (int index)
 
void preItemsAppended (uint count)
 
void preListChanged ()
 
void updateModel (int index, QVector< int > roles)
 

Public Slots

void append (const QString &tag)
 
void append (const QStringList &tags)
 
void appendItem (const QVariantMap &tag)
 
bool contains (const QString &tag)
 
void erase (const int &index)
 
bool insert (const QString &tag)
 
void insertToUrls (const QString &tag)
 
void refresh ()
 
bool remove (const int &index)
 
void removeFrom (const int &index, const QString &url)
 
void removeFromUrls (const int &index)
 
void removeFromUrls (const QString &tag)
 
void updateToUrls (const QStringList &tags)
 
- Public Slots inherited from MauiList
QVariantMap get (const int &index) const
 

Public Member Functions

 TagsList (QObject *parent=nullptr)
 
void componentComplete () override final
 
bool getStrict () const
 
QStringList getTags () const
 
QStringList getUrls () const
 
const FMH::MODEL_LISTitems () const override
 
void setStrict (const bool &value)
 
void setUrls (const QStringList &value)
 
- Public Member Functions inherited from MauiList
 MauiList (QObject *parent=nullptr)
 
virtual void classBegin () override
 
FMH::MODEL getItem (const int &index) const
 
virtual void modelHooked ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from MauiList
bool exists (const FMH::MODEL_KEY &key, const QString &value) const
 
int indexOf (const FMH::MODEL_KEY &key, const QString &value) const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

The TagsList class A model ready to be consumed by QML.

Has basic support for browsing and handling, associating, adding and removing tags.

This is a basic model for most actions supported by the MauiKit File Browsing Tagging system. For more details on supported actions and complete API documentation refer to the Tagging page.

See also
Tagging
Note
This class is exposed as a QML type with the name of TagsListModel.

Definition at line 21 of file tagslist.h.

Property Documentation

◆ strict

QML_ELEMENTbool TagsList::strict
readwrite

Whether the retrieved tags should be only associated to the current application or to any other app.

By default this is set to true, so the lookup will be only matching tags associated to the given URLs that were created by the current application.

Definition at line 32 of file tagslist.h.

◆ tags

QStringList TagsList::tags
read

The resulting list of tag names that were found.

Definition at line 42 of file tagslist.h.

◆ urls

QStringList TagsList::urls
readwrite

The list of file URLs to look for their tags.

Definition at line 37 of file tagslist.h.

Constructor & Destructor Documentation

◆ TagsList()

TagsList::TagsList ( QObject * parent = nullptr)
explicit

Definition at line 4 of file tagslist.cpp.

Member Function Documentation

◆ append [1/2]

void TagsList::append ( const QString & tag)
slot

Adds a given tag to the model, if the tag already exists in the model then nothing happens.

Note
This operation does not inserts the tag to the tagging data base. To insert a new tag see the insert function.
See also
insert
Parameters
tagthe tag to be added to the model

Definition at line 164 of file tagslist.cpp.

◆ append [2/2]

void TagsList::append ( const QStringList & tags)
slot

Adds a given list of tags to the model.

Tags that already exists in the model are ignored.

Parameters
tagslist of tags to be added to the model.
See also
append

Definition at line 185 of file tagslist.cpp.

◆ appendItem

void TagsList::appendItem ( const QVariantMap & tag)
slot

Adds a given tag map to the model, if the tag map already exists in the model then nothing happens.

Note
This operation does not inserts the tag to the tagging data base.
Parameters
tagthe tag map to be added to the model. The supported key values are: tag, color, date

Definition at line 169 of file tagslist.cpp.

◆ componentComplete()

void TagsList::componentComplete ( )
finaloverridevirtual

Reimplemented from MauiList.

Definition at line 198 of file tagslist.cpp.

◆ contains

bool TagsList::contains ( const QString & tag)
slot

Checks whether a given tag name is already in the model list.

Parameters
tagtag name to look up
Returns
whether the tag exists

Definition at line 193 of file tagslist.cpp.

◆ erase

void TagsList::erase ( const int & index)
slot

Removes a tag from the tagging data base.

This operation will remove the association of the tag to the current application making the request, meaning that if the tag is also associated to another application then the tag will be conserved.

Parameters
index

Definition at line 121 of file tagslist.cpp.

◆ getStrict()

bool TagsList::getStrict ( ) const

Definition at line 131 of file tagslist.cpp.

◆ getTags()

QStringList TagsList::getTags ( ) const

Definition at line 145 of file tagslist.cpp.

◆ getUrls()

QStringList TagsList::getUrls ( ) const

Definition at line 150 of file tagslist.cpp.

◆ insert

bool TagsList::insert ( const QString & tag)
slot

Inserts a tag to the tagging data base.

Parameters
tagto be inserted
Returns
if the tag already exists in the data base then it return false, if the operation is successful returns true otherwise false

Definition at line 34 of file tagslist.cpp.

◆ insertToUrls

void TagsList::insertToUrls ( const QString & tag)
slot

Associates a given tag to the current file URLs set to the URLs property.

Parameters
taga tag to be associated, if the tag doesn't exists then it gets created

Definition at line 42 of file tagslist.cpp.

◆ items()

const FMH::MODEL_LIST & TagsList::items ( ) const
overridevirtual

Implements MauiList.

Definition at line 126 of file tagslist.cpp.

◆ refresh

void TagsList::refresh ( )
slot

Reloads the model, checking the tags from the given list of file URLs.

Definition at line 29 of file tagslist.cpp.

◆ remove

bool TagsList::remove ( const int & index)
slot

Removes a tag from the model at a given index.

The tag is removed from the model but not from the tagging data base

Parameters
indexindex position of the tag in the model. If the model has been filtered or ordered using the MauiKit BaseModel then it should use the mapped index.
Returns

Definition at line 99 of file tagslist.cpp.

◆ removeFrom

void TagsList::removeFrom ( const int & index,
const QString & url )
slot

Removes a tag at the given index in the model from the given file URL.

This removes the associated file URL from the tagging data base and the tag from the model

Parameters
indexindex of the tag in the model
urlfile URL

Definition at line 112 of file tagslist.cpp.

◆ removeFromUrls [1/2]

void TagsList::removeFromUrls ( const int & index)
slot

Removes a tag at a given index in the model from the all the file URLs currently set.

Parameters
indexindex of the tag in the model.

Definition at line 75 of file tagslist.cpp.

◆ removeFromUrls [2/2]

void TagsList::removeFromUrls ( const QString & tag)
slot

Removes a given tag name from the current list of file URLs set.

Parameters
tagthe tag name

Definition at line 93 of file tagslist.cpp.

◆ setStrict()

void TagsList::setStrict ( const bool & value)

Definition at line 136 of file tagslist.cpp.

◆ setUrls()

void TagsList::setUrls ( const QStringList & value)

Definition at line 155 of file tagslist.cpp.

◆ updateToUrls

void TagsList::updateToUrls ( const QStringList & tags)
slot

Updates a list of tags associated to the current file URLs.

All the previous tags associated to each file URL are removed and replaced by the new ones

Parameters
tagstags to be updated

Definition at line 53 of file tagslist.cpp.


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

KDE's Doxygen guidelines are available online.