-
-
Notifications
You must be signed in to change notification settings - Fork 106
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 PySide6 support for qta-browser #171
Conversation
Hi. diff --git a/qtawesome/iconic_font.py b/qtawesome/iconic_font.py
index a89a088..ca3ca1b 100644
--- a/qtawesome/iconic_font.py
+++ b/qtawesome/iconic_font.py
@@ -405,7 +405,8 @@ class IconicFont(QObject):
def font(self, prefix, size):
"""Return a QFont corresponding to the given prefix and size."""
- font = QFont(self.fontname[prefix])
+ font = QFont()
+ font.setFamily(self.fontname[prefix])
font.setPixelSize(round(size))
if prefix[-1] == 's': # solid style
font.setStyleName('Solid') |
@5yutan5, Thank you for the comment.
I checked it worked well on pyqt5 and pyside6. |
@kumattau, No problem. Thanks for this work👍 |
About diff --git a/qtawesome/icon_browser.py b/qtawesome/icon_browser.py
index ea11916..7eb0e63 100644
--- a/qtawesome/icon_browser.py
+++ b/qtawesome/icon_browser.py
@@ -95,14 +95,8 @@ class IconBrowser(QtWidgets.QMainWindow):
# QApplication.desktop() has been removed in Qt 6.
# Instead, QGuiApplication.screenAt is supported in Qt 5.10 or later.
- try:
- desktop = QtWidgets.QApplication.desktop()
- screen = desktop.screenNumber(desktop.cursor().pos())
- centerPoint = desktop.screenGeometry(screen).center()
- except:
- screen = QtGui.QGuiApplication.screenAt(QtGui.QCursor.pos())
- centerPoint = screen.geometry().center()
-
+ geo = self.geometry()
+ centerPoint = QtGui.QGuiApplication.primaryScreen().availableGeometry().center()
geo.moveCenter(centerPoint)
self.setGeometry(geo) |
Hi, @5yutan5
There is the following difference if screen#0 (primary) and screen#1 (secondary) exist.
The original code and my fix show a window on the screen where there is a cursor, |
@kumattau, ok. |
@5yutan5, yes that's right. |
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.
Thank you @kumattau for noticing this and submitting the corresponding fixes! I left some suggestions for the except
blocks but otherwise this LGTM 👍
Co-authored-by: Daniel Althviz Moré <[email protected]>
@dalthviz thank you for the review. |
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.
This PR is for that qta-browser supports PySide6.
I tested the PR on Linux(x11) and multi-screen.
Please note that qta-browser cannot show correct icons until PySide6's PYSIDE-1685 is released.
By the following workaround, qta-browser works with current PySide6 6.2.0,
but I does not apply the workaround because I think it is not responsibility of qta-browser.
Fixes #170