-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Display variable values in VarListWidget #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -59,6 +59,14 @@ def set_time_offset(self, time_offset): | |||||||||||||||||||||||||||||||||
| self.model().set_time_offset(time_offset) | ||||||||||||||||||||||||||||||||||
| self.timeChanged.emit() | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| def set_show_values(self, show): | ||||||||||||||||||||||||||||||||||
| self.model().set_show_values(show) | ||||||||||||||||||||||||||||||||||
| self.model().layoutChanged.emit() | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| def update_tick(self, tick): | ||||||||||||||||||||||||||||||||||
| self.model().set_current_tick(tick) | ||||||||||||||||||||||||||||||||||
| self.model().layoutChanged.emit() | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+62
to
+68
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For better performance and adherence to Qt's model/view architecture, it's preferable to use
Suggested change
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| def close(self): | ||||||||||||||||||||||||||||||||||
| self.onClose.emit() | ||||||||||||||||||||||||||||||||||
| return super().close() | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for creating the display text can be refactored to improve readability and reduce repetition. By preparing the value as a string first and then constructing the final display text in one place, you can avoid repeating the
f"{var_name}: ..."pattern and have a singlereturnstatement for this part of the logic.