-
-
Notifications
You must be signed in to change notification settings - Fork 153
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: Add missing QtGui
utility function to QtCore.Qt
for PySide bindings
#313
Conversation
QtGui
utility function to QtCore.Qt
for PySide bindingsQtGui
utility function to QtCore.Qt
for PySide bindings
QtGui
utility function to QtCore.Qt
for PySide bindingsQtGui
utility function to QtCore.Qt
for PySide bindings
QtGui
utility function to QtCore.Qt
for PySide bindingsQtGui
utility function to QtCore.Qt
for PySide bindings
9542944
to
9de93c6
Compare
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.
Thanks @dalthviz for this! I left two small comments, otherwise looks good to me.
28723d3
to
f94ceca
Compare
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.
Thanks @dalthviz ! Looks like @ccordoba12 's suggestions were implemented, so this is ready to go with a couple trivial comments
Improve comment punctuation/caps Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
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.
Looks good to me now, thanks @dalthviz!
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.
LGTM now, thanks @dalthviz !
Merging so we can fix the tests in the other PRs. |
# trying to import `PyQt6.QtGui.Qt`, some functions like | ||
# `PyQt6.QtCore.Qt.mightBeRichText` are missing. | ||
try: | ||
from PyQt6.QtGui import Qt |
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.
Just out of curiosity, shouldn't this overwrite the Qt
imported from PyQt6.QtCore
a bit earlier?
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.
I've stumbled upon the issue #311 while looking through the comments in the qtpy.QtCore
code. Although it's merged ages ago, I'd like to discuss the fix a little.
What versions of PyQt6
, PySide2
, and PySide6
require the fix? I can't tell whether the code is long obsolete or still needed. Please clarify this somewhere.
Due the dates the issue was raised and fixed I would guess that is needed for Qt 6.1 or 6.2 bindings (although not completely sure 🤔). Also, did a quick check using PySide2 5.15.2.1 and I got this: So the fix is at least required by PySide 5.15.2.1. Could you give it a try to the Qt 6.2 bindings to check if the fix is still necessary there? |
So, the tests I've conducted gave the following results:
So, the fix is required for all current But that's not all.
Shouldn't def convertFromPlainText(plain: str, mode: Qt.WhiteSpaceMode = Qt.WhiteSpaceMode.WhiteSpacePre) -> str:
import html
plain = html.escape(plain)
if mode == Qt.WhiteSpaceMode.WhiteSpacePre:
plain = plain.replace(" ", "\xa0").replace("\t", "\xa0" * 4)
return "<p>" + plain + "</p>" |
Thanks for the new info @StSav012 ! Could you open a new issue with your findings? Seems like we need to work in a couple of things indeed |
I'm unsure whether it's worth it. I've run
All but the two first ones differ. Does anyone need the functions to spend time porting them? As for |
I guess for the moment no since no issue has been opened regarding that but it's good to know the variations that we could potentially handle And thanks for opening the issue! |
Fixes #311
Edit: Also fixes an issue with PyQt6 and sip to use
mightBeRichText
: