10#ifndef FILTER_EXPRESSION_EDIT_H
11#define FILTER_EXPRESSION_EDIT_H
23class QConcatenateTablesProxyModel;
54class FilterExpressionEdit :
public FilterEdit
59 explicit FilterExpressionEdit(QWidget *parent =
nullptr);
109 const QString &save_current,
110 const QString &remove_current,
111 const QString &manage,
112 const QString &preferences);
162 void rebuildBookmarkEntries();
163 void populateHistoryMenu();
164 void updateClearVisible();
165 void updateApplyEnabled();
166 void updateRemoveEnabled();
167 void updateBookmarkState();
168 void updateInlineMargins();
169 void rebuildInlineLayout();
171 QMargins inlineMargins();
181 QHBoxLayout *inline_layout_;
183 QIcon normal_bookmark_icon_;
184 QIcon matching_bookmark_icon_;
186 QMenu *bookmark_menu_;
187 QMenu *history_menu_;
190 QAction *save_action_;
191 QAction *remove_action_;
192 QAction *manage_action_;
193 QAction *preferences_action_;
194 QAction *static_separator_;
195 QString saved_section_label_;
196 QList<QAction *> entry_actions_;
200 QConcatenateTablesProxyModel *completion_source_;
203 bool buttons_left_aligned_;
Abstract list model of saved ("bookmarked") filter expressions.
Definition bookmark_model.h:30
void setHistoryModel(FilterHistoryModel *model)
Sets the recent-history model. Caller-owned: the widget keeps a non-owning reference and never delete...
Definition filter_expression_edit.cpp:275
void paintEvent(QPaintEvent *event) override
Paints the field, then the bookmark/apply zone dividers on top.
Definition filter_expression_edit.cpp:549
QConcatenateTablesProxyModel * completionModel() const
The merged history+bookmark model that backs typeahead completion. Owned by the widget; references (d...
Definition filter_expression_edit.h:119
void manageBookmarksRequested()
"Manage" chosen in the bookmark menu.
void setApplyActionVisible(bool visible)
Shows or hides the apply (→) action, selecting explicit- vs implicit-apply mode. Hidden by default.
Definition filter_expression_edit.cpp:327
FilterHistoryModel * historyModel() const
The injected history model, or nullptr.
Definition filter_expression_edit.h:69
void setBookmarkModel(BookmarkModel *model)
Sets the bookmark model. Widget-owned: deleted with the widget and replacing any previous model....
Definition filter_expression_edit.cpp:294
void cleared()
The clear action was triggered (distinct from typing to empty).
BookmarkModel * bookmarkModel() const
The bookmark model, or nullptr.
Definition filter_expression_edit.h:78
void saveBookmarkRequested(const QString &expression)
"Save current" chosen in the bookmark menu.
void applyExpression()
Validates the final text and, if applyable, emits applied() and records the expression to history....
Definition filter_expression_edit.cpp:361
void setBookmarkIcon(const QIcon &normal, const QIcon &matching)
Sets the leading bookmark glyphs: normal in the per-filter colour and matching shown when the current...
Definition filter_expression_edit.cpp:335
bool isApplyActionVisible() const
True when the apply action is present (explicit-apply mode).
Definition filter_expression_edit.h:87
bool buttonsLeftAligned() const
True when the inline buttons are left-aligned.
Definition filter_expression_edit.h:130
void setBookmarkMenuLabels(const QString &saved_section, const QString &save_current, const QString &remove_current, const QString &manage, const QString &preferences)
Supplies the bookmark-menu label strings. Menu structure, behaviour and enablement are identical acro...
Definition filter_expression_edit.cpp:347
void applied(const QString &expression)
The current expression was applied (action, or Enter).
void setPreferencesActionVisible(bool visible)
Shows or hides the bookmark menu's "preferences" item. Filter types without a relevant preferences pa...
Definition filter_expression_edit.cpp:342
void validityChanged(bool valid)
Convenience: emitted with (state == Valid || state == Deprecated).
void removeBookmarkRequested(const QString &expression)
"Remove current" chosen in the bookmark menu.
void preferencesRequested()
"Preferences" chosen in the bookmark menu.
void textChangedExpr(const QString &expression)
The expression text changed (distinct from QLineEdit::textChanged).
void setButtonsLeftAligned(bool left)
Left-aligns the inline buttons (all clustered after the bookmark, with the text to their right) inste...
Definition filter_expression_edit.cpp:492
Abstract list model of recently applied filter expressions.
Definition filter_history_model.h:30