Skip to content

Save/restore main window UI state across sessions - #1083

Open
minoseigenheer wants to merge 2 commits into
collin80:QT6WIPfrom
minoseigenheer:pr/save-restore-main-window
Open

Save/restore main window UI state across sessions#1083
minoseigenheer wants to merge 2 commits into
collin80:QT6WIPfrom
minoseigenheer:pr/save-restore-main-window

Conversation

@minoseigenheer

Copy link
Copy Markdown

Summary

Persists the main window checkbox states and column widths across application restarts, targeting the QT6WIP branch.

Changes (3463a57)

Previously only window geometry was saved. This change extends persistence to the four main-view toggle checkboxes and their associated model state:

Setting QSettings key
AutoScroll Main/AutoScroll
Interpret Main/Interpret
Overwrite Main/Overwrite
Persistent Filters Main/PersistentFilters

Each checkbox's toggled signal now immediately writes its new state, and readSettings() restores each checkbox and applies the corresponding model setting (e.g. setOverwriteMode, setClearMode) on startup so the view behaves consistently from the first frame.

Column widths are also now saved and restored when the hex+dec data column is active.

Files changed

  • mainwindow.cpp/.h
  • mainsettingsdialog.cpp

minoseigenheer and others added 2 commits May 15, 2026 10:39
Persist the four main-window toggle states to QSettings so they survive
an application restart.

- interpretAutoScroll() slot added; connected to cbAutoScroll toggled
  signal; writes Main/AutoScroll on every change
- interpretToggled(), overwriteToggled(), presistentFiltersToggled() each
  now save their state (Main/Interpret, Main/Overwrite,
  Main/PersistentFilters) before applying the model change
- readSettings() re-applies all four toggles on startup, including the
  matching model setters (setInterpretMode, setOverwriteMode, setClearMode)
  so model state matches the UI on launch

Co-authored-by: Gediminas Simanskis <gediminas@rusoku.com>
When overwrite mode was saved in the last session and restored on startup,
the Cnt column (FrameCount) was not shown because hideColumn() is called
unconditionally after readSettings() in the constructor, and the cbOverwrite
toggled signal is not yet connected at that point so showColumn() was never
triggered.

Fix: after hideColumn(), immediately restore the column if the checkbox was
already set by readSettings().
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