From 8a8ed575cf597f3319e679ab6b43776fef6b3eba Mon Sep 17 00:00:00 2001 From: Liezl Maree <38435167+roomrys@users.noreply.github.com> Date: Fri, 16 Aug 2024 07:44:07 -0700 Subject: [PATCH] Replace QtDesktop widget in preparation for PySide6 (#1908) * Replace to-be-depreciated QDesktopWidget * Remove unused imports and sort remaining imports --- sleap/gui/learning/dialog.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/sleap/gui/learning/dialog.py b/sleap/gui/learning/dialog.py index 184088897..2c2617036 100644 --- a/sleap/gui/learning/dialog.py +++ b/sleap/gui/learning/dialog.py @@ -1,23 +1,20 @@ """ Dialogs for running training and/or inference in GUI. """ -import cattr -import os +import json import shutil -import atexit import tempfile from pathlib import Path +from typing import Dict, List, Optional, Text, cast + +import cattr +from qtpy import QtCore, QtGui, QtWidgets import sleap from sleap import Labels, Video from sleap.gui.dialogs.filedialog import FileDialog from sleap.gui.dialogs.formbuilder import YamlFormWidget -from sleap.gui.learning import runners, scopedkeydict, configs, datagen, receptivefield - -from typing import Dict, List, Text, Optional, cast - -from qtpy import QtWidgets, QtCore -import json +from sleap.gui.learning import configs, datagen, receptivefield, runners, scopedkeydict # List of fields which should show list of skeleton nodes NODE_LIST_FIELDS = [ @@ -171,7 +168,7 @@ def __init__( def adjust_initial_size(self): # Get screen size - screen = QtWidgets.QDesktopWidget().screenGeometry() + screen = QtGui.QGuiApplication.primaryScreen().availableGeometry() max_width = 1860 max_height = 1150