Fix #14011 (crash: GUI crash when trying to hide a result from xml file)#7985
Merged
danmar merged 10 commits intodanmar:mainfrom Nov 27, 2025
Merged
Fix #14011 (crash: GUI crash when trying to hide a result from xml file)#7985danmar merged 10 commits intodanmar:mainfrom
danmar merged 10 commits intodanmar:mainfrom
Conversation
655edf3 to
5b3e23e
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a GUI crash (issue #14011) when hiding results from XML files by replacing the QVariant-based data storage approach with a strongly-typed ResultItem class. The refactoring improves type safety and maintainability by using QSharedPointer<ErrorItem> instead of QVariantMap for storing error data in tree items.
Key changes:
- Introduced
ResultItemclass inheriting fromQStandardItemwith type-safe access to error data - Replaced all QVariantMap-based data storage and retrieval with direct ErrorItem access
- Removed unused
ShowTypeToSeverityandVariantToShowTypefunctions - Updated
ErrorItem::samecomparison logic to use hash comparison only when both items have hashes - Added comprehensive tests for multiline results and results in the same file
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| gui/resultitem.h | New ResultItem class with Type enum (file/message/note) and errorItem pointer |
| gui/resultitem.cpp | ResultItem constructor implementation |
| gui/resultstree.h | Updated method signatures to use ResultItem* instead of QStandardItem* |
| gui/resultstree.cpp | Major refactoring replacing QVariantMap with ResultItem, direct ErrorItem access |
| gui/resultsview.h | Changed updateDetails to accept ResultItem* instead of QModelIndex |
| gui/resultsview.cpp | Simplified updateDetails to access ErrorItem fields directly |
| gui/erroritem.h | Added helper methods (getMainLocIndex, getFile, isClangResult, filterMatch) and renamed sameCID to same |
| gui/erroritem.cpp | Updated ErrorItem::same comparison logic and toString format |
| gui/showtypes.h | Removed unused ShowTypeToSeverity and VariantToShowType declarations |
| gui/showtypes.cpp | Removed unused function implementations |
| gui/test/resultstree/testresultstree.h | Added test method declarations for multiline and same-file results |
| gui/test/resultstree/testresultstree.cpp | Implemented comprehensive tests for new functionality |
| gui/test/resultstree/CMakeLists.txt | Added resultitem.h and resultitem.cpp to build |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



No description provided.