Fix TTD Memory Query widget scroll bar clipping issue #877
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When there are many results in the TTD Memory Query widget, the scroll bar doesn't work properly, and the last few results can only be seen when closing the bottom sidebars. This makes it difficult to view and interact with all query results, particularly when working with large TTD memory traces.
Root Cause
The issue was caused by fixed minimum size constraints on the widgets:
TTDMemoryQueryWidget
hadsetMinimumSize(800, 600)
TTDMemoryWidget
hadsetMinimumSize(900, 700)
These hard-coded minimum sizes prevented the widgets from properly adapting to the available space when placed in a sidebar. When the sidebar was constrained vertically (e.g., by bottom sidebars being open), the fixed minimum sizes caused the table widget to extend beyond the visible area. Since the parent widgets couldn't shrink below their minimum sizes, Qt's layout system was unable to properly allocate space, resulting in the table being clipped and the scroll bar becoming non-functional.
Solution
Replaced the fixed minimum size constraints with proper Qt size policies:
QSizePolicy::Expanding
on bothTTDMemoryQueryWidget
andTTDMemoryWidget
to allow them to adapt to available sidebar spaceQSizePolicy::Expanding
on the results table (m_resultsTable
) to ensure it properly expands and contracts within the layoutThis follows Qt best practices for widgets in dynamic layouts, allowing the layout system to properly manage widget sizes based on available space while ensuring the scroll bar functions correctly.
Impact
Fixes #[issue_number]
Original prompt
Fixes #872
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.