★ wanayoo — archive 1999 https://github.com/paceholder/nodeeditor/issues/237Nouvelle recherche | Portail wanayoo
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

dynamic_cast #237

Open
sindney opened this issue May 28, 2019 · 1 comment
Open

dynamic_cast #237

sindney opened this issue May 28, 2019 · 1 comment

Comments

@sindney
Copy link
Contributor

@sindney sindney commented May 28, 2019

return (dynamic_cast<NodeGraphicsObject*>(item) != nullptr);

Found 2 dynamic_cast here, i assume we should use qgraphicsitem_cast instead, so our app won't crash when there's not just NodeGraphicsObject in the scene.

@paceholder
Copy link
Owner

@paceholder paceholder commented Jan 24, 2020

Sorry, I can't see how the app could crash here.
If the casted object item is not NodeGraphicsObject, then dynamic_cast would return nullptr and the whole lambda function returns false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.