mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Fix typing. [CURA-6478]
This commit is contained in:
parent
c3a9ceaa18
commit
ad9fc62ff5
1 changed files with 11 additions and 4 deletions
|
@ -23,6 +23,7 @@ from UM.Platform import Platform
|
||||||
from UM.PluginError import PluginNotFoundError
|
from UM.PluginError import PluginNotFoundError
|
||||||
from UM.Resources import Resources
|
from UM.Resources import Resources
|
||||||
from UM.Preferences import Preferences
|
from UM.Preferences import Preferences
|
||||||
|
from UM.Qt.Bindings import MainWindow
|
||||||
from UM.Qt.QtApplication import QtApplication # The class we're inheriting from.
|
from UM.Qt.QtApplication import QtApplication # The class we're inheriting from.
|
||||||
import UM.Util
|
import UM.Util
|
||||||
from UM.View.SelectionPass import SelectionPass # For typing.
|
from UM.View.SelectionPass import SelectionPass # For typing.
|
||||||
|
@ -1789,10 +1790,16 @@ class CuraApplication(QtApplication):
|
||||||
|
|
||||||
@pyqtSlot(result = int)
|
@pyqtSlot(result = int)
|
||||||
def appWidth(self) -> int:
|
def appWidth(self) -> int:
|
||||||
main_window = cast(UM.Qt.Bindings.MainWindow, QtApplication.getInstance().getMainWindow())
|
main_window = QtApplication.getInstance().getMainWindow()
|
||||||
return main_window.width()
|
if main_window:
|
||||||
|
return main_window.width()
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
@pyqtSlot(result = int)
|
@pyqtSlot(result = int)
|
||||||
def appHeight(self) -> int:
|
def appHeight(self) -> int:
|
||||||
main_window = cast(UM.Qt.Bindings.MainWindow, QtApplication.getInstance().getMainWindow())
|
main_window = QtApplication.getInstance().getMainWindow()
|
||||||
return main_window.height()
|
if main_window:
|
||||||
|
return main_window.height()
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue