|
Krita Source Code Documentation
|
The TagFilterProxyModelQmlWrapper class. More...
#include <TagFilterProxyModelQmlWrapper.h>
Inheritance diagram for TagFilterProxyModelQmlWrapper:Classes | |
| struct | Private |
Signals | |
| void | activeTagChanged () |
| void | currentResourceChanged () |
| void | modelChanged () |
| void | modelSortUpdated () |
| void | resourceTypeChanged () |
| void | searchInTagChanged () |
| void | searchTextChanged () |
| void | tagModelChanged () |
Public Member Functions | |
| Q_INVOKABLE void | addNewTag (const QString &newTagName, const int &resourceIndex=-1) |
| Add new tag. | |
| int | currentIndex () const |
| Current resource index in tagfilterproxy. | |
| KoResourceSP | currentResource () const |
| current resource. | |
| int | currentTag () const |
| Return row of current tag in tag model. | |
| bool | importEnabled () const |
| Returns whether the current resource has a ResourceLocator. | |
| Q_INVOKABLE void | importResource () |
| Import a resource with file picker. | |
| QAbstractItemModel * | model () const |
| The tagfilterproxymodel. | |
| Q_INVOKABLE void | removeResource () |
| Disable the currently selected resource. | |
| QString | resourceFilename () |
| File name of the current resource. | |
| QString | resourceName () const |
| Name of current resource. | |
| QString | resourceType () const |
| The current resource type. | |
| QString | resourceTypeName () const |
| bool | searchInTag () |
| Whether "search in tag is enabled". | |
| QString | searchText () const |
| The current search text on the filter model. | |
| void | setCurrentIndex (const int &index) |
| Set the resource index in tagfilterproxy. | |
| void | setResourceToFileName (const QString &filename) |
| Set current resource to resource file name. | |
| void | setResourceToName (const QString &name) |
| void | setResourceType (const QString &type) |
| void | setSearchInTag (const bool &newSearchInTag) |
| Toggle "search in tag". | |
| void | setSearchText (const QString &text) |
| Q_INVOKABLE bool | showResourceTagged (const int &tagIndex, const int &resourceIndex) const |
| Is the resource tagged with the current tagindex. | |
| void | tagActivated (const int &row) |
| Select tag at row in tag model. | |
| TagFilterProxyModelQmlWrapper (QObject *parent=nullptr) | |
| Q_INVOKABLE QVariantList | taggedResourceModel (const int &resourceIndex) const |
| Get a variantlist with the tags for the given resource index. | |
| QAbstractItemModel * | tagModel () const |
| Associated tagmodel. | |
| Q_INVOKABLE void | tagResource (const int &tagIndex, const int &resourceIndex) |
| Tag the resource. | |
| Q_INVOKABLE QVariant | testFileName (const QString &name) |
| Test if the given filename is in the resources. | |
| Q_INVOKABLE QVariant | testName (const QString &name) |
| Test if the given name is in the resources. | |
| Q_INVOKABLE void | untagResource (const int &tagIndex, const int &resourceIndex) |
| Untag the resource. | |
| ~TagFilterProxyModelQmlWrapper () | |
Properties | |
| int | currentIndex |
| KoResourceSP | currentResource |
| int | currentTag |
| bool | importEnabled |
| QAbstractItemModel * | model |
| QString | resourceFilename |
| QString | resourceName |
| QString | resourceType |
| QString | resourceTypeName |
| bool | searchInTag |
| QString | searchText |
| QAbstractItemModel * | tagModel |
Private Slots | |
| void | setSearchTextOnModel () |
Private Attributes | |
| const QScopedPointer< Private > | d |
The TagFilterProxyModelQmlWrapper class.
This class wraps around KisTagFilterResourceProxyModel, providing properties, signal compressors and handling setting the source model.
Definition at line 20 of file TagFilterProxyModelQmlWrapper.h.
| TagFilterProxyModelQmlWrapper::TagFilterProxyModelQmlWrapper | ( | QObject * | parent = nullptr | ) |
Definition at line 52 of file TagFilterProxyModelQmlWrapper.cpp.
References connect(), d, and setSearchTextOnModel().
| TagFilterProxyModelQmlWrapper::~TagFilterProxyModelQmlWrapper | ( | ) |
Definition at line 60 of file TagFilterProxyModelQmlWrapper.cpp.
|
signal |
| void TagFilterProxyModelQmlWrapper::addNewTag | ( | const QString & | newTagName, |
| const int & | resourceIndex = -1 ) |
Add new tag.
Definition at line 158 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and KisAbstractResourceModel::Id.
| int TagFilterProxyModelQmlWrapper::currentIndex | ( | ) | const |
| KoResourceSP TagFilterProxyModelQmlWrapper::currentResource | ( | ) | const |
|
signal |
| int TagFilterProxyModelQmlWrapper::currentTag | ( | ) | const |
| bool TagFilterProxyModelQmlWrapper::importEnabled | ( | ) | const |
Returns whether the current resource has a ResourceLocator.
Definition at line 105 of file TagFilterProxyModelQmlWrapper.cpp.
References d, KisResourceLoaderRegistry::instance(), and KisResourceLoaderRegistry::resourceTypes().
| void TagFilterProxyModelQmlWrapper::importResource | ( | ) |
Import a resource with file picker.
We have overridden the currently selected resource and nothing is selected now
Definition at line 340 of file TagFilterProxyModelQmlWrapper.cpp.
References currentResource, d, KisResourceUserOperations::importResourceFileWithUserInput(), KisResourceLoaderRegistry::instance(), KisResourceLoaderRegistry::mimeTypes(), KoFileDialog::OpenFiles, and setCurrentIndex().
| QAbstractItemModel * TagFilterProxyModelQmlWrapper::model | ( | ) | const |
The tagfilterproxymodel.
Definition at line 64 of file TagFilterProxyModelQmlWrapper.cpp.
References d.
|
signal |
|
signal |
| void TagFilterProxyModelQmlWrapper::removeResource | ( | ) |
Disable the currently selected resource.
Definition at line 364 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and setCurrentIndex().
| QString TagFilterProxyModelQmlWrapper::resourceFilename | ( | ) |
File name of the current resource.
| QString TagFilterProxyModelQmlWrapper::resourceName | ( | ) | const |
Name of current resource.
Definition at line 285 of file TagFilterProxyModelQmlWrapper.cpp.
References d.
| QString TagFilterProxyModelQmlWrapper::resourceType | ( | ) | const |
The current resource type.
Definition at line 74 of file TagFilterProxyModelQmlWrapper.cpp.
References d.
|
signal |
| QString TagFilterProxyModelQmlWrapper::resourceTypeName | ( | ) | const |
The property translated name for the current resource type. This might assert if there's no proper translated name.
Definition at line 98 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and ResourceName::resourceTypeToName().
| bool TagFilterProxyModelQmlWrapper::searchInTag | ( | ) |
Whether "search in tag is enabled".
|
signal |
| QString TagFilterProxyModelQmlWrapper::searchText | ( | ) | const |
The current search text on the filter model.
Definition at line 128 of file TagFilterProxyModelQmlWrapper.cpp.
References d.
|
signal |
| void TagFilterProxyModelQmlWrapper::setCurrentIndex | ( | const int & | index | ) |
Set the resource index in tagfilterproxy.
Definition at line 253 of file TagFilterProxyModelQmlWrapper.cpp.
References currentResourceChanged(), and d.
| void TagFilterProxyModelQmlWrapper::setResourceToFileName | ( | const QString & | filename | ) |
Set current resource to resource file name.
Definition at line 265 of file TagFilterProxyModelQmlWrapper.cpp.
References currentResourceChanged(), and d.
| void TagFilterProxyModelQmlWrapper::setResourceToName | ( | const QString & | name | ) |
Definition at line 290 of file TagFilterProxyModelQmlWrapper.cpp.
References currentResourceChanged(), and d.
| void TagFilterProxyModelQmlWrapper::setResourceType | ( | const QString & | type | ) |
Setting the current resource type, this expects a resource type from KisResourceTypes, as this will be passed onto the initializers of the all internal resource related models.
Definition at line 79 of file TagFilterProxyModelQmlWrapper.cpp.
References activeTagChanged(), currentResourceChanged(), d, modelChanged(), modelSortUpdated(), resourceTypeChanged(), searchInTagChanged(), searchTextChanged(), and tagModelChanged().
| void TagFilterProxyModelQmlWrapper::setSearchInTag | ( | const bool & | newSearchInTag | ) |
Toggle "search in tag".
Definition at line 143 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and searchInTagChanged().
| void TagFilterProxyModelQmlWrapper::setSearchText | ( | const QString & | text | ) |
Definition at line 133 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and searchTextChanged().
|
privateslot |
Slot to set the search text on the model via a signal compressor. The search can be quite slow, so the signal compressor can elevate the delay here.
Definition at line 377 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and modelSortUpdated().
| bool TagFilterProxyModelQmlWrapper::showResourceTagged | ( | const int & | tagIndex, |
| const int & | resourceIndex ) const |
Is the resource tagged with the current tagindex.
Definition at line 227 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and KisAbstractResourceModel::Id.
| void TagFilterProxyModelQmlWrapper::tagActivated | ( | const int & | row | ) |
Select tag at row in tag model.
Definition at line 110 of file TagFilterProxyModelQmlWrapper.cpp.
References activeTagChanged(), and d.
| QVariantList TagFilterProxyModelQmlWrapper::taggedResourceModel | ( | const int & | resourceIndex | ) | const |
Get a variantlist with the tags for the given resource index.
Definition at line 206 of file TagFilterProxyModelQmlWrapper.cpp.
References d, KisAbstractResourceModel::Id, and taggedResourceModel().
| QAbstractItemModel * TagFilterProxyModelQmlWrapper::tagModel | ( | ) | const |
|
signal |
| void TagFilterProxyModelQmlWrapper::tagResource | ( | const int & | tagIndex, |
| const int & | resourceIndex ) |
Tag the resource.
Definition at line 176 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and KisAbstractResourceModel::Id.
| QVariant TagFilterProxyModelQmlWrapper::testFileName | ( | const QString & | name | ) |
Test if the given filename is in the resources.
Definition at line 310 of file TagFilterProxyModelQmlWrapper.cpp.
References d, ResourceType::FontFamilies, resourceType, and KisFontFunctions::wwsFontFamilyNameVariant().
| QVariant TagFilterProxyModelQmlWrapper::testName | ( | const QString & | name | ) |
Test if the given name is in the resources.
Definition at line 327 of file TagFilterProxyModelQmlWrapper.cpp.
References d.
| void TagFilterProxyModelQmlWrapper::untagResource | ( | const int & | tagIndex, |
| const int & | resourceIndex ) |
Untag the resource.
Definition at line 191 of file TagFilterProxyModelQmlWrapper.cpp.
References d, and KisAbstractResourceModel::Id.
|
private |
Definition at line 147 of file TagFilterProxyModelQmlWrapper.h.
|
readwrite |
Definition at line 33 of file TagFilterProxyModelQmlWrapper.h.
|
read |
Definition at line 37 of file TagFilterProxyModelQmlWrapper.h.
|
readwrite |
Definition at line 31 of file TagFilterProxyModelQmlWrapper.h.
|
read |
Definition at line 28 of file TagFilterProxyModelQmlWrapper.h.
|
read |
Definition at line 23 of file TagFilterProxyModelQmlWrapper.h.
|
readwrite |
Definition at line 36 of file TagFilterProxyModelQmlWrapper.h.
|
readwrite |
Definition at line 35 of file TagFilterProxyModelQmlWrapper.h.
|
readwrite |
Definition at line 26 of file TagFilterProxyModelQmlWrapper.h.
|
read |
Definition at line 27 of file TagFilterProxyModelQmlWrapper.h.
|
readwrite |
Definition at line 32 of file TagFilterProxyModelQmlWrapper.h.
|
readwrite |
Definition at line 30 of file TagFilterProxyModelQmlWrapper.h.
|
read |
Definition at line 24 of file TagFilterProxyModelQmlWrapper.h.