17 #include <QActionGroup>
22 #include <QPushButton>
23 #include <QSortFilterProxyModel>
25 #include <QStandardItemModel>
27 #include <QThreadPool>
29 #include <unordered_set>
58 using QSortFilterProxyModel::QSortFilterProxyModel;
62 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
65 void SetFilterColumn(int64_t nFilterColumn);
66 void ClearMatchingData();
67 void SetMatchingTexts(
const QSet<QString>& oMatchingTexts);
70 bool filterAcceptsRow(
int source_row,
const QModelIndex& source_parent)
const override;
72 void ClearMatchings();
76 int64_t m_nFilterColumn = -1;
78 bool m_bUseMatchingData =
false;
80 QSet<QString> m_setMatchingTexts;
113 void ShowBottomBorder(
bool show);
125 uint64_t GetSelectedFilterColumn()
const;
130 void SetFilterColumnNames(
const std::vector<QString>& vecFilterColumnNames);
135 void SetFilterColumnNamesFromModel(
const QAbstractItemModel& oModel);
141 void SetSearchText(
const QString& strSearchText);
154 void SelectFilterType(
FilterType oFilterType);
162 void SetCaseSensitive(
bool bCaseSensitive);
165 bool event(QEvent* event)
override;
170 void SetItemTextOutOfDate();
172 void HandleChangedSearchParameters(
bool bTextChanged);
174 void SearchNormalString();
175 void SearchWildcard();
176 void SearchRegexString();
179 QSet<QString> ComputeItemTexts(
const QModelIndex& oModelIndex,
const uint64_t nFilterColumn);
180 void ComputeTreeModelIndexs(
const QModelIndex& oModelIndex,
181 const uint64_t nFilterColumn,
182 const std::function<
void(
const QModelIndex& oIndex)>& fnCallback);
185 bool m_bShowBottomBorder =
true;
188 QAbstractItemModel* m_pSourceModel =
nullptr;
190 QLineEdit* m_pSearchTextLineEdit =
nullptr;
191 QLabel* m_pErrorLabel =
nullptr;
192 QToolButton* m_pClearButton =
nullptr;
193 QMenu* m_pFilterMenu =
nullptr;
194 QActionGroup* m_pFilterActionGroup =
nullptr;
195 QAction* m_pFuzzyFilterAction =
nullptr;
196 QAction* m_pCaseSensitiveAction =
nullptr;
197 QPushButton* m_pFilterButton =
nullptr;
198 QMenu* m_pFilterColumnMenu =
nullptr;
199 QActionGroup* m_pFilterColumnActionGroup =
nullptr;
200 QWidget* m_pFuzzyParametersWidget =
nullptr;
201 QSpinBox* m_pFuzzyScaledScoreThresholdSpinBox =
nullptr;
203 bool m_bIsInInitialization =
false;
205 QSet<QString> m_setItemTextCache;
207 QThreadPool m_oSearchThreadPool;
208 std::atomic<bool> m_bSearchCanceled =
false;
209 bool m_bSearchRequested =
false;
210 std::chrono::time_point<std::chrono::system_clock> m_oKeyPressedTimestamp;
Copyright © Audi Electronics Venture GmbH.
cSearchTextWidget allows to filter a given QSortProxyModel to be filtered by normal text,...
bool IsCaseSensitive() const
Returns whether 'case sensitive' is selected.
void selectedFilterColumnChanged()
This signal is emitted when the selected filter column changed.
void Clear()
Clears the search text.
void resultChanged()
This signal is emitted when the filtered result changed.
void searchParametersChanged()
This signal is emitted when the search parameters changed.
Namespace for entire ADTF SDK.