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

PR: toPython helpers for QDate and QTime #361

Merged
merged 4 commits into from
Aug 12, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions qtpy/QtCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
from PyQt5.QtCore import QT_VERSION_STR as __version__

# For issue #153 and updated for issue #305
from PyQt5.QtCore import QDateTime
from PyQt5.QtCore import QDate, QDateTime, QTime
QDate.toPython = lambda self, *args, **kwargs: self.toPyDate(*args, **kwargs)
QDateTime.toPython = lambda self, *args, **kwargs: self.toPyDateTime(*args, **kwargs)
QTime.toPython = lambda self, *args, **kwargs: self.toPyTime(*args, **kwargs)

# Map missing methods on PyQt5 5.12
QTextStreamManipulator.exec_ = lambda self, *args, **kwargs: self.exec(*args, **kwargs)
Expand All @@ -39,8 +41,10 @@
from PyQt6.QtCore import QT_VERSION_STR as __version__

# For issue #153 and updated for issue #305
from PyQt6.QtCore import QDateTime
from PyQt6.QtCore import QDate, QDateTime, QTime
QDate.toPython = lambda self, *args, **kwargs: self.toPyDate(*args, **kwargs)
QDateTime.toPython = lambda self, *args, **kwargs: self.toPyDateTime(*args, **kwargs)
QTime.toPython = lambda self, *args, **kwargs: self.toPyTime(*args, **kwargs)

# For issue #311
# Seems like there is an error with sip. Without first
Expand Down