mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
remove usage of 'desktop' from codebase
This commit is contained in:
parent
6032a3332b
commit
1cf1696108
3 changed files with 8 additions and 23 deletions
|
|
@ -678,11 +678,6 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
self._help_dialog.show()
|
||||
|
||||
window = self.window()
|
||||
if hasattr(QtWidgets.QApplication, "desktop"):
|
||||
desktop = QtWidgets.QApplication.desktop()
|
||||
screen_idx = desktop.screenNumber(window)
|
||||
screen_geo = desktop.screenGeometry(screen_idx)
|
||||
else:
|
||||
screen = window.screen()
|
||||
screen_geo = screen.geometry()
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ class PickScreenColorWidget(QtWidgets.QWidget):
|
|||
color_selected = QtCore.Signal(QtGui.QColor)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(PickScreenColorWidget, self).__init__(parent)
|
||||
super().__init__(parent)
|
||||
self.labels = []
|
||||
self.magnification = 2
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ class PickLabel(QtWidgets.QLabel):
|
|||
close_session = QtCore.Signal()
|
||||
|
||||
def __init__(self, pick_widget):
|
||||
super(PickLabel, self).__init__()
|
||||
super().__init__()
|
||||
self.setMouseTracking(True)
|
||||
|
||||
self.pick_widget = pick_widget
|
||||
|
|
@ -74,14 +74,10 @@ class PickLabel(QtWidgets.QLabel):
|
|||
self.show()
|
||||
self.windowHandle().setScreen(screen_obj)
|
||||
geo = screen_obj.geometry()
|
||||
args = (
|
||||
QtWidgets.QApplication.desktop().winId(),
|
||||
pix = screen_obj.grabWindow(
|
||||
self.winId(),
|
||||
geo.x(), geo.y(), geo.width(), geo.height()
|
||||
)
|
||||
if qtpy.API in ("pyqt4", "pyside"):
|
||||
pix = QtGui.QPixmap.grabWindow(*args)
|
||||
else:
|
||||
pix = screen_obj.grabWindow(*args)
|
||||
|
||||
if pix.width() > pix.height():
|
||||
size = pix.height()
|
||||
|
|
|
|||
|
|
@ -53,12 +53,6 @@ def checkstate_enum_to_int(state):
|
|||
|
||||
def center_window(window):
|
||||
"""Move window to center of it's screen."""
|
||||
|
||||
if hasattr(QtWidgets.QApplication, "desktop"):
|
||||
desktop = QtWidgets.QApplication.desktop()
|
||||
screen_idx = desktop.screenNumber(window)
|
||||
screen_geo = desktop.screenGeometry(screen_idx)
|
||||
else:
|
||||
screen = window.screen()
|
||||
screen_geo = screen.geometry()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue