Classes | |
| class | BackgroundSortFilterRowsBase |
| The non-template portion of `BackgroundSortFilterRows`. More... | |
| struct | BackgroundSortFilterRowsBase::ModelHooks |
| class | BackgroundSortFilterRows< Row > |
| Append-only row storage for table models that filters and sorts rows on the worker pool. More... | |
| class | FilterTarget |
| class | FilterEdit |
| class | FilteredView |
Enumerations | |
| enum | FilterOption { NoFilterOption = 0 , CaseSensitiveOption = 1 , UseRegexOption = 2 } |
| class BackgroundSortFilterRowsBase |
The non-template portion of `BackgroundSortFilterRows`.
Contains the background job state machine, watcher lifecycle, and abandonment protocol, which are independent of the row type.
Public Member Functions | |
| BackgroundSortFilterRowsBase (ModelHooks hooks) | |
| virtual | ~BackgroundSortFilterRowsBase () |
| BackgroundSortFilterRowsBase (const BackgroundSortFilterRowsBase &)=delete | |
| BackgroundSortFilterRowsBase & | operator= (const BackgroundSortFilterRowsBase &)=delete |
| bool | busy () const |
| bool | filtering () const |
| bool | sorting () const |
Protected Types | |
| enum class | JobKind { Filter , Sort } |
Protected Member Functions | |
| void | assertOwningThread () const |
| void | shutdown () |
| void | abandonJob () |
| void | beginJob (JobKind kind, uint64_t filterGeneration, QFuture< void > future) |
| bool | filterChangedDuringJob () const |
| virtual void | commitJob (JobKind kind)=0 |
Protected Attributes | |
| ModelHooks | m_hooks |
| std::atomic< uint64_t > | m_filterGeneration = 0 |
|
strongprotected |
|
inlineexplicit |
|
inlinevirtual |
|
delete |
|
delete |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
protectedpure virtual |
Implemented in BackgroundSortFilterRows< Row >.
|
protected |
|
protected |
| struct BackgroundSortFilterRowsBase::ModelHooks |
| class BackgroundSortFilterRows |
Append-only row storage for table models that filters and sorts rows on the worker pool.
Filtering and sorting run as QtConcurrent jobs. Changing the filter abandons a running job at its next check and re-runs with the latest predicate, so rapid filter changes stay responsive. Appends and sorts requested while a job is running are deferred and applied when the job commits, allowing the job to read the rows without locking.
All methods must be called on the thread the object was created on (the GUI thread for table models): the job state machine and row vectors are single-thread-confined, with the worker threads communicating back only through the watcher's queued finished signal, and reading only the atomic generation counters and the unmutated rows. The filter predicate and comparator are called concurrently from worker threads and must be thread-safe.
Public Types | |
| using | Predicate = std::function<bool(const Row&)> |
| using | PredicateFactory = std::function<Predicate()> |
| using | Comparator = std::function<bool(const Row&, const Row&)> |
| using | Index = uint32_t |
Public Member Functions | |
| BackgroundSortFilterRows (ModelHooks hooks) | |
| ~BackgroundSortFilterRows () override | |
| size_t | displayCount () const |
| const Row & | displayAt (size_t index) const |
| size_t | totalCount () const |
| void | clear () |
| void | append (std::vector< Row > rows) |
| void | setFilter (Predicate filter) |
| void | setFilterFactory (PredicateFactory factory) |
| void | sort (Comparator comparator) |
| Public Member Functions inherited from BackgroundSortFilterRowsBase | |
| BackgroundSortFilterRowsBase (ModelHooks hooks) | |
| virtual | ~BackgroundSortFilterRowsBase () |
| BackgroundSortFilterRowsBase (const BackgroundSortFilterRowsBase &)=delete | |
| BackgroundSortFilterRowsBase & | operator= (const BackgroundSortFilterRowsBase &)=delete |
| bool | busy () const |
| bool | filtering () const |
| bool | sorting () const |
Protected Member Functions | |
| void | commitJob (JobKind kind) override |
| Protected Member Functions inherited from BackgroundSortFilterRowsBase | |
| void | assertOwningThread () const |
| void | shutdown () |
| void | abandonJob () |
| void | beginJob (JobKind kind, uint64_t filterGeneration, QFuture< void > future) |
| bool | filterChangedDuringJob () const |
Additional Inherited Members | |
| Protected Types inherited from BackgroundSortFilterRowsBase | |
| enum class | JobKind { Filter , Sort } |
| Protected Attributes inherited from BackgroundSortFilterRowsBase | |
| ModelHooks | m_hooks |
| std::atomic< uint64_t > | m_filterGeneration = 0 |
| using BackgroundSortFilterRows< Row >::Predicate = std::function<bool(const Row&)> |
| using BackgroundSortFilterRows< Row >::PredicateFactory = std::function<Predicate()> |
| using BackgroundSortFilterRows< Row >::Comparator = std::function<bool(const Row&, const Row&)> |
| using BackgroundSortFilterRows< Row >::Index = uint32_t |
|
inlineexplicit |
|
inlineoverride |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverrideprotectedvirtual |
Implements BackgroundSortFilterRowsBase.
| class FilterTarget |
Public Member Functions | |
| virtual | ~FilterTarget () |
| virtual void | setFilter (const std::string &filter, FilterOptions options)=0 |
| virtual void | scrollToFirstItem ()=0 |
| virtual void | scrollToCurrentItem ()=0 |
| virtual void | ensureSelection ()=0 |
| virtual void | activateSelection ()=0 |
| virtual void | closeFilter () |
|
inlinevirtual |
|
pure virtual |
Implemented in BndbImportDialog, LogView, ManagedTableView, SearchResultHeaderWidget, StringsView, SymbolList, TagList, TypeBrowserView, and VariableList.
|
pure virtual |
Implemented in BndbImportDialog, LogView, ManagedTableView, SearchResultHeaderWidget, StringsView, SymbolList, TagList, TypeBrowserView, and VariableList.
|
pure virtual |
Implemented in BndbImportDialog, LogView, ManagedTableView, SearchResultHeaderWidget, StringsView, SymbolList, TagList, TypeBrowserView, and VariableList.
|
pure virtual |
Implemented in BndbImportDialog, LogView, ManagedTableView, SearchResultHeaderWidget, StringsView, SymbolList, TagList, TypeBrowserView, and VariableList.
|
pure virtual |
Implemented in BndbImportDialog, LogView, ManagedTableView, SearchResultHeaderWidget, StringsView, SymbolList, TagList, TypeBrowserView, and VariableList.
|
virtual |
Reimplemented in BndbImportDialog, and LogView.
| class FilterEdit |
Signals | |
| void | optionsChanged (FilterOptions options) |
Public Member Functions | |
| FilterEdit (FilterTarget *target) | |
| void | showRegexToggle (bool enabled) |
| void | setRegexValidationError (const QString &error) |
| FilterOptions | getFilterOptions () const |
Protected Member Functions | |
| virtual void | paintEvent (QPaintEvent *event) override |
| virtual void | keyPressEvent (QKeyEvent *event) override |
| FilterEdit::FilterEdit | ( | FilterTarget * | target | ) |
| void FilterEdit::showRegexToggle | ( | bool | enabled | ) |
| void FilterEdit::setRegexValidationError | ( | const QString & | error | ) |
|
inline |
|
signal |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
| class FilteredView |
Public Member Functions | |
| FilteredView (QWidget *parent, QWidget *filtered, FilterTarget *target, FilterEdit *edit=nullptr) | |
| void | setFilterPlaceholderText (const QString &text) |
| void | setFilterToolTip (const QString &text) |
| void | updateFonts () |
| void | clearFilter () |
| void | showFilter (const QString &initialText) |
| void | focusAndSelectFilter () |
| bool | hasFilterText () const |
Static Public Member Functions | |
| static bool | match (const std::string &name, const std::string &filter, bool caseSensitive=false) |
| FilteredView::FilteredView | ( | QWidget * | parent, |
| QWidget * | filtered, | ||
| FilterTarget * | target, | ||
| FilterEdit * | edit = nullptr ) |
| void FilteredView::setFilterPlaceholderText | ( | const QString & | text | ) |
| void FilteredView::setFilterToolTip | ( | const QString & | text | ) |
| void FilteredView::updateFonts | ( | ) |
| void FilteredView::clearFilter | ( | ) |
| void FilteredView::showFilter | ( | const QString & | initialText | ) |
| void FilteredView::focusAndSelectFilter | ( | ) |
| bool FilteredView::hasFilterText | ( | ) | const |
|
static |
| enum FilterOption |