Skip to content

Fix blank x-axis after Qt6 migration - #2304

Open
andreidanila1 wants to merge 2 commits into
mainfrom
fix-x-axis
Open

andreidanila1 wants to merge 2 commits into
mainfrom
fix-x-axis

Conversation

@andreidanila1

Copy link
Copy Markdown
Contributor
  1. Datalogger: Fix blank x-axis labels on Qt6 (Qt::OffsetFromUTC is handled differently in Qt6 compared to Qt5)
  2. gui: Fix blank x-axis labels on Qt6/ARM (plot instruments: SWIOT, PQM)
    • Due to label overlapping, nothing was displayed on the x-axis (the problem was found on armhf)

For more details, read the commit messages.

Qt6 rejects Qt::OffsetFromUTC offsets beyond ±14h, so the old
setUtcOffset(-m_startTime/1000) produced invalid QDateTimes and
empty x-axis labels (zero extent -> collapsed axis). Replace the
offset abuse with a TimeScaleDraw that shifts the label value,
keeping data in absolute epoch and preserving pre-Qt6 behavior.

Signed-off-by: andreidanila1 <andrei.danila@analog.com>
The label overlap loop in BasicScaleDraw::draw() removed ticks from a
shrinking list, decimating down to ~1 label whenever wider (ARM
fontconfig-substituted) fonts caused overlap. Replace it with
stride-based decimation that keeps >=2 labels, guard against an empty
scaleDiv, and stop half padding from collapsing to 0 for pixel-sized
fonts (pointSize() == -1).

Signed-off-by: andreidanila1 <andrei.danila@analog.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant