Skip to content

SpectrumWidget: remove dead drawFpsMeters() painter path #2602

Description

@ten9876

Background

PR #2578 fixed the per-second FPS-meter stutter by promoting the PAN/WF readouts from painter-drawn-into-overlay-QImage to two QLabel children of SpectrumWidget. As part of that change, drawFpsMeters() was kept in place but gated with an early-return when both labels exist:

void SpectrumWidget::drawFpsMeters(QPainter& p, const QRect& specRect, const QRect& wfRect)
{
    if (!m_showFpsMeters)
        return;
    if (m_panFpsMeterLabel && m_wfFpsMeterLabel) {
        return;   // ← always true after construction
    }
    // ... legacy painter implementation follows
}

The labels are unconditionally constructed in the SpectrumWidget constructor via createFpsMeterLabels(), so the painter path is unreachable in practice. It survives only as a defensive fallback against label-construction failure (which doesn't realistically happen — new QLabel(this) only fails on OOM, and at that point the app is in a much worse state).

Suggested cleanup

  1. Delete the body of drawFpsMeters() and its declaration in SpectrumWidget.h.
  2. Remove its call sites in the GPU and raster paint paths (renderGpuFrame() and paintEvent()).
  3. Remove any related painter setup that's exclusive to this function (font save/restore, color picks).

Estimated diff: ~40 lines removed, no behavioral change since the painter path doesn't fire today.

Scope and risk

  • Pure dead-code removal once verified
  • The m_panadapterFps / m_waterfallFps members and m_fpsMeterTimer stay (they drive the labels)
  • The recordPanadapterFrame() / recordWaterfallFrame() accumulators stay
  • No protocol, persistence, or UX change

Context

Anyone (including AetherClaude) can pick this up — small, well-scoped, mechanical.

73, Jeremy KK7GWY & Claude (AI dev partner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIUser interfaceenhancementImprovement to existing featuregood first issueGood for newcomersmaintainer-reviewRequires maintainer review before any action is takenspectrumPanadapter and waterfall

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions