gui: minor cleanups in Chiplet3DWidget#9486
gui: minor cleanups in Chiplet3DWidget#9486maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request provides several minor cleanups to the Chiplet3DWidget. The changes include renaming constants to follow a consistent naming convention, adding const to variables that are not modified, and refactoring some code for conciseness. These changes improve code readability and maintainability. I have one suggestion to further improve the code by replacing a magic number with a named constant, in line with the other changes in this PR.
| QPen pen(color); | ||
| pen.setWidth(2); | ||
| painter.setPen(pen); | ||
| painter.setPen(QPen(color, 2)); |
There was a problem hiding this comment.
To improve readability and maintainability, it's better to replace the magic number 2 with a named constant. This is consistent with the other cleanups in this PR. Ideally, this constant would be defined at the top of the file with the others, but since that's outside the changed lines, a local constexpr is a good alternative.
| painter.setPen(QPen(color, 2)); | |
| constexpr int kPenWidth = 2; | |
| painter.setPen(QPen(color, kPenWidth)); |
References
- Define tunable parameters as named constants instead of using hardcoded magic numbers.
|
clang-tidy review says "All clean, LGTM! 👍" |
dcf3613
into
The-OpenROAD-Project:master
No description provided.