Skip to content

Replace QPlainTextEdit log viewer with virtualized QListView-based architecture #2531

Description

@buhtz

🚫 AI-generated code submissions are not welcome. 🚫
⚠️ If you cannot demonstrate full authorship, understanding, and responsibility for your submitted content, your account might be reported to the GitHub/Microsoft abuse team without warning.


Problem description

The current log viewer is implemented using QPlainTextEdit to display rsync log files. This approach does not scale to large log files (observed up to ~700 MB). Users reporting UI freezes and crashes (#456, #867, #890, #2530). The root cause is likely that the entire log content is loaded and rendered as a single text document.

Goals

Proposed solution

This is a quick n dirty idea, not a fixed requirement. It is open for discussion.

Replace the current text-based log viewer with a Qt Model/View architecture using QListView.

Core design

  • QListView as display widget
  • custom QAbstractListModel to manage log entries
  • Each log line is represented as a lightweight item (no full text buffer in memory)
  • Qt handles virtualized rendering (only visible rows)

Data handling

  • Log file is not fully loaded into memory
  • Background worker builds index of file: byte offsets per line
  • Optional parsing of metadata (timestamp, severity level, rsync status)
  • Lazy loading of lines via file seek operations

Filtering

  • Filtering is applied at model level, not UI level
  • QSortFilterProxyModel or precomputed filtered index lists
  • No full file re-parsing on filter changes

Rendering in UI

  • QStyledItemDelegate for custom rendering:
    • severity-based colors (ERROR / WARN / INFO)
    • icons per log level
    • structured layout (timestamp + message)
  • Maybe highlighting of filter matches

Architecture overview

  • Worker thread:
    • parses file
    • builds line index (offset table)
    • extracts metadata
  • QAbstractListModel:
    • exposes indexed log lines
    • performs lazy file reads via seek()
  • QListView:
    • virtualized rendering of visible items only
  • Delegate:
    • handles visual representation and styling

Metadata

Metadata

Assignees

No one assigned

    Labels

    Discussiondecision or consensus neededFeaturerequests a new featureGUI & CosmeticsRelated to the graphical interface. Not specific to Qt, which has a different label.Logging & diagnosticsQtQt bugs, code or features

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions