Skip to content
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

ui: remove copy initialization of dialogs #33427

Merged
merged 1 commit into from
Sep 1, 2024

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Sep 1, 2024

This PR updates dialog-based objects to use direct initialization rather than copy initialization, aligning with Qt's design principles and preventing undefined behavior.

QWidget and its subclasses, including QDialog, are non-copyable: QWidget explicitly disables copying to avoid complications with the underlying GUI resource management. Attempting to copy these objects can lead to undefined behavior and resource management problems. Using direct initialization enhances code stability, ensures proper dialog handling, and reduces the risk of runtime errors.

@github-actions github-actions bot added the ui label Sep 1, 2024
Copy link
Contributor

github-actions bot commented Sep 1, 2024

UI Screenshots

@adeebshihadeh adeebshihadeh merged commit dc06813 into commaai:master Sep 1, 2024
18 checks passed
@deanlee deanlee deleted the ui_no_init_from_copy branch September 1, 2024 17:05
fredyshox pushed a commit that referenced this pull request Sep 4, 2024
remove copy initialization of dialogs
old-commit-hash: dc06813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants