Skip to content

fix: Set objectName on Diagnostics QDockWidget#1261

Open
chrisc-lee wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
chrisc-lee:diagnosticsObjectName
Open

fix: Set objectName on Diagnostics QDockWidget#1261
chrisc-lee wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
chrisc-lee:diagnosticsObjectName

Conversation

@chrisc-lee
Copy link
Copy Markdown
Contributor

Linked issues

No linked issue, just a trivial one line fix.

Summarize your change.

Added setting the object name for the Diagnostics dock widget immediately after the dock widget is constructed to avoid a runtime warning.

Describe the reason for the change.

QMainWindow::saveState() requires all dock widgets to have an objectName set in order to correctly save and restore their layout. The Diagnostics dock was created without one, which produces this runtime warning on every call to saveState():

WARNING: QMainWindow::saveState(): 'objectName' not set for QDockWidget 0x... 'Diagnostics'

Other dock widgets and menus in RvDocument.cpp already follow this pattern (e.g. UIBlockingOverlay, Main Popup, User Popup). This brings the Diagnostics dock in line with them.

Describe what you have tested and on which operating system.

Verified the warning is no longer emitted on Linux (EL9) after applying the change.

Add a list of changes, and note any that might need special attention during the review.

  • src/lib/app/RvCommon/RvDocument.cpp, just one line added, no logic change.

QMainWindow::saveState() requires all dock widgets to have an
objectName set in order to save and restore their state. The
Diagnostics dock was created without one, causing a runtime
warning on every call to saveState().

Signed-off-by: Chris <34953610+chrisc-lee@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@bernie-laberge bernie-laberge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and I validated the fix.
Thank you @chrisc-lee !

@bernie-laberge bernie-laberge added the PR: In Progress PR is being reviewed by code reviewer. label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: In Progress PR is being reviewed by code reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants