mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Avoid error in PySide6+
This commit is contained in:
parent
acbfb5985b
commit
40125fa6a5
1 changed files with 13 additions and 6 deletions
|
|
@ -98,15 +98,22 @@ class Popup(QtWidgets.QDialog):
|
|||
height = window.height()
|
||||
height = max(height, window.sizeHint().height())
|
||||
|
||||
desktop_geometry = QtWidgets.QDesktopWidget().availableGeometry()
|
||||
screen_geometry = window.geometry()
|
||||
try:
|
||||
screen = QtWidgets.QApplication.primaryScreen()
|
||||
desktop_geometry = screen.availableGeometry()
|
||||
except AttributeError:
|
||||
# Backwards compatibility for older Qt versions
|
||||
# PySide6 removed QDesktopWidget
|
||||
desktop_geometry = QtWidgets.QDesktopWidget().availableGeometry()
|
||||
|
||||
screen_width = screen_geometry.width()
|
||||
screen_height = screen_geometry.height()
|
||||
window_geometry = window.geometry()
|
||||
|
||||
screen_width = window_geometry.width()
|
||||
screen_height = window_geometry.height()
|
||||
|
||||
# Calculate width and height of system tray
|
||||
systray_width = screen_geometry.width() - desktop_geometry.width()
|
||||
systray_height = screen_geometry.height() - desktop_geometry.height()
|
||||
systray_width = window_geometry.width() - desktop_geometry.width()
|
||||
systray_height = window_geometry.height() - desktop_geometry.height()
|
||||
|
||||
padding = 10
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue