• OctoMY API
  • OctoMY API Reference
  • C++ Classes
  • libconfigui
  • ConfigFilterProxy
  • config::ui::ConfigFilterProxy Class

    class config::ui::ConfigFilterProxy

    The filter of the settings window: one linear pass per change. More...

    Header: #include <ConfigFilterProxy>
    Inherits: QSortFilterProxyModel

    Detailed Description

    QSortFilterProxyModel with recursive filtering walks the tree with no memory for each row and checks each ancestor, three to four calls of filterAcceptsRow() per row on each keystroke (config-ui §CFGV-4). This proxy keeps recursive filtering off. On a change of the text, of "Changed only" or of "Show advanced", it makes one pass over the setting nodes of the source:

    1. The text is split into words. A setting matches when every word is in its folded search text, the model's string of label, description, id, category labels and keywords.
    2. The pass writes one bit per node and a match count per category and section. A container passes when one of its settings does.
    3. filterAcceptsRow() then reads one bit.

    The pass is runFilterPass(), a pure function over the model's immutable FilterIndex. From ASYNC_NODES nodes it runs on a worker, because the release benchmark measured 50 ms at 1 000 000 settings (gate §CFGW-2). The GUI thread makes the input, the worker makes the bits, and the GUI thread applies them. A newer pass makes an older one stop.

    The bits change only in a pass, so an edit never hides the row it edits, even with dynamicSortFilter set. With "Changed only", a row reset to its default stays until the next pass.