8000 Add QtCompat.isValid() by OEP · Pull Request #316 · mottosso/Qt.py · GitHub
[go: up one dir, main page]

Skip to content

Add QtCompat.isValid() #316

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

Merged
merged 4 commits into from
May 31, 2019
Merged

Add QtCompat.isValid() #316

merged 4 commits into from
May 31, 2019

Conversation

OEP
Copy link
Contributor
@OEP OEP commented Mar 30, 2019

I brought this up originally in #53 where wrapInstance() and friends were being discussed, and its cousin delete() was added in #286. It feels appropriate to add this now.

This checks the deleted state of the underlying C++ object, which is useful for Python programmers who are about to make calls on a QObject and have some reason to believe it may have been deleted out from under them.

This is a wrapper around:

* shiboken.isValid()
* shiboken2.isValid()
* sip.isdeleted()

if Qt.IsPyQt4 or Qt.IsPyQt5:
isdeleted = getattr(Qt, "_sip").isdeleted
def func(obj):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 1 blank line before a nested definition, found 0

@CLAassistant
Copy link
CLAassistant commented Mar 30, 2019

CLA assistant check
All committers have signed the CLA.

@mottosso
Copy link
Owner

Looks great to me, thank you! For consistency, I'd prefer if you could sign the CLA to protect users and future contributors from legal trouble.

@mottosso
Copy link
Owner

Sorry for the delay on this one, completely slipped my mind. Thanks @OEP

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

Successfully merging this pull request may close these issues.

4 participants
0