ADTF Qt5
Loading...
Searching...
No Matches
fuzzy_match.h
Go to the documentation of this file.
1
7
8/*
9 * This file depends on Qt which is licensed under LGPLv3.
10 * See ADTF_DIR/3rdparty/qt5 and doc/license for detailed information.
11 */
12
13#pragma once
14
15#include <adtf_utils.h>
16
17#include <QLocale>
18#include <QString>
19
20namespace adtf
21{
22namespace ui
23{
24namespace widget
25{
26namespace detail
27{
32{
33public:
35 struct cParameters
36 {
37 QLocale::Language m_oLanguage = QLocale::C;
38 QString m_strText;
39 QString m_strSearchText;
40 bool m_bCaseSensitive = false;
41 // initialized with "empirical" value. Controls the max char difference weight.
42 uint64_t m_nMaxCharDiffWeight = 10;
43 };
44
45 cFuzzyMatch(const cParameters& oParameters);
46
47 int64_t GetScore() const;
49private:
55 int64_t ComputeScore(const QString& strA, const QString& strB);
56
57private:
59 cParameters m_oParameters;
60 int64_t m_nScore{};
62};
63} // namespace detail
64
65} // namespace widget
66} // namespace ui
67} // namespace adtf
Definition fuzzy_match.h:32
Namespace for all provided widget functionality helper.
Definition filter_model_treeview.h:25
Namespace for the ADTF UI SDK.
Definition adtfui_pkg.h:13
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtfui_pkg.h:13