diff --git a/setup.cfg b/setup.cfg index 3ea6a3b..2575ebd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -79,7 +79,7 @@ pyqt6 = pyside2 = pyside2 pyside6 = - pyside6<6.4.0 + pyside6 quantity = pint testing = diff --git a/src/superqt/fonticon/_qfont_icon.py b/src/superqt/fonticon/_qfont_icon.py index 4491660..50575b2 100644 --- a/src/superqt/fonticon/_qfont_icon.py +++ b/src/superqt/fonticon/_qfont_icon.py @@ -356,10 +356,9 @@ class QFontIconStore(QObject): def __init__(self, parent: Optional[QObject] = None) -> None: super().__init__(parent=parent) - # QT6 drops this - dpi = getattr(Qt.ApplicationAttribute, "AA_UseHighDpiPixmaps", None) - if dpi: - QApplication.setAttribute(dpi) + if tuple(QT_VERSION.split(".")) < ("6", "0"): + # QT6 drops this + QApplication.setAttribute(Qt.ApplicationAttribute.AA_UseHighDpiPixmaps) @classmethod def instance(cls) -> QFontIconStore: diff --git a/src/superqt/utils/_code_syntax_highlight.py b/src/superqt/utils/_code_syntax_highlight.py index 47d4fe0..f2640aa 100644 --- a/src/superqt/utils/_code_syntax_highlight.py +++ b/src/superqt/utils/_code_syntax_highlight.py @@ -18,7 +18,10 @@ def get_text_char_format(style): """ text_char_format = QtGui.QTextCharFormat() - text_char_format.setFontFamily("monospace") + if hasattr(text_char_format, "setFontFamilies"): + text_char_format.setFontFamilies(["monospace"]) + else: + text_char_format.setFontFamily("monospace") if style.get("color"): text_char_format.setForeground(QtGui.QColor(f"#{style['color']}")) diff --git a/tests/test_sliders/_testutil.py b/tests/test_sliders/_testutil.py index 7b61497..15994fd 100644 --- a/tests/test_sliders/_testutil.py +++ b/tests/test_sliders/_testutil.py @@ -20,10 +20,11 @@ def _mouse_event(pos=QPointF(), type_=QEvent.Type.MouseMove): """Create a mouse event of `type_` at `pos`.""" return QMouseEvent( type_, - QPointF(pos), - Qt.MouseButton.LeftButton, - Qt.MouseButton.LeftButton, - Qt.KeyboardModifier.NoModifier, + QPointF(pos), # localPos + QPointF(), # windowPos / globalPos + Qt.MouseButton.LeftButton, # button + Qt.MouseButton.LeftButton, # buttons + Qt.KeyboardModifier.NoModifier, # modifiers )