Skip to content

Commit

Permalink
Add blank lines for better readability, as suggested by @ccordoba12
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Cordoba <[email protected]>
  • Loading branch information
2 people authored and CAM-Gerlach committed Mar 21, 2023
1 parent 4265297 commit 5c6dd9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qtpy/QtGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

if PYQT5:
from PyQt5.QtGui import *

# Backport items moved to QtGui in Qt6
from PyQt5.QtWidgets import QAction, QActionGroup, QFileSystemModel, QShortcut, QUndoCommand

elif PYQT6:
from PyQt6 import QtGui
from PyQt6.QtGui import *
Expand All @@ -33,16 +33,20 @@
del QtGui
elif PYSIDE2:
from PySide2.QtGui import *

# Backport items moved to QtGui in Qt6
from PySide2.QtWidgets import QAction, QActionGroup, QFileSystemModel, QShortcut, QUndoCommand

if hasattr(QFontMetrics, 'horizontalAdvance'):
# Needed to prevent raising a DeprecationWarning when using QFontMetrics.width
QFontMetrics.width = lambda self, *args, **kwargs: self.horizontalAdvance(*args, **kwargs)
elif PYSIDE6:
from PySide6.QtGui import *
from PySide6.QtOpenGL import *

# Backport `QFileSystemModel` moved to QtGui in Qt6
from PySide6.QtWidgets import QFileSystemModel

QFontMetrics.width = lambda self, *args, **kwargs: self.horizontalAdvance(*args, **kwargs)
QFontMetricsF.width = lambda self, *args, **kwargs: self.horizontalAdvance(*args, **kwargs)

Expand Down

0 comments on commit 5c6dd9c

Please sign in to comment.