|
Krita Source Code Documentation
|
Namespaces | |
| namespace | fuzzy_internal |
Functions | |
| static Q_DECL_UNUSED bool | fuzzy_match (const QString pattern, const QString str, int &outScore) |
| This should be the main function you should use. outscore is the score of this match and should be used to sort the results later. Without sorting of the results this function won't be as effective. | |
| static Q_DECL_UNUSED bool | fuzzy_match (const QString pattern, const QString str, int &outScore, uint8_t *matches, int maxMatches) |
| static Q_DECL_UNUSED bool | fuzzy_match_sequential (const QString pattern, const QString str, int &outScore) |
| This is a special case function which doesn't score separator matches higher than sequential matches. This is currently used in Kate's command bar where the string items are usually space separated names. | |
| static Q_DECL_UNUSED bool | fuzzy_match_simple (const QString pattern, const QString str) |
| simple fuzzy matching of chars in pattern with chars in str sequentially | |
| static Q_DECL_UNUSED QString | to_fuzzy_matched_display_string (const QString pattern, QString &str, const QString &htmlTag, const QString &htmlTagClose) |
| get string for display in treeview / listview. This should be used from style delegate. For example: with pattern = "kate", str = "kateapp" and @htmlTag = " the output will be kateapp which will be visible to user as kateapp. | |
This is based on https://github.com/forrestthewoods/lib_fts/blob/master/code/fts_fuzzy_match.h with modifications for Qt
Dont include this file in a header file, please :)
|
static |
This should be the main function you should use. outscore is the score of this match and should be used to sort the results later. Without sorting of the results this function won't be as effective.
Definition at line 83 of file kfts_fuzzy_match.h.
References fuzzy_match().
|
static |
Definition at line 89 of file kfts_fuzzy_match.h.
References kfts::fuzzy_internal::fuzzy_match_recursive().
|
static |
This is a special case function which doesn't score separator matches higher than sequential matches. This is currently used in Kate's command bar where the string items are usually space separated names.
Definition at line 101 of file kfts_fuzzy_match.h.
References kfts::fuzzy_internal::fuzzy_match_recursive().
|
static |
simple fuzzy matching of chars in pattern with chars in str sequentially
Definition at line 72 of file kfts_fuzzy_match.h.
|
static |
get string for display in treeview / listview. This should be used from style delegate. For example: with pattern = "kate", str = "kateapp" and @htmlTag = " the output will be kateapp which will be visible to user as kateapp.
TODO: improve this so that we don't have to put html tags on every char probably using some kind of interval container
FIXME Don't do so many appends. Instead consider using some interval based solution to wrap a range of text with the html <tag></tag>
FIXME Don't do so many appends. Instead consider using some interval based solution to wrap a range of text with the html <tag></tag>
Definition at line 273 of file kfts_fuzzy_match.h.