Skip to content
Snippets Groups Projects

Fix typing in Scheduler GUI

Merged Oscar Gustafsson requested to merge schedulerguityping into master
4 files
+ 33
33
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -44,7 +44,7 @@ class AxesItem(QGraphicsItemGroup):
@@ -44,7 +44,7 @@ class AxesItem(QGraphicsItemGroup):
_width: int
_width: int
_width_indent: float
_width_indent: float
_width_padding: float
_width_padding: float
_height: int
_height: float
_height_indent: float
_height_indent: float
_height_padding: float
_height_padding: float
_x_axis: QGraphicsLineItem
_x_axis: QGraphicsLineItem
@@ -63,7 +63,7 @@ class AxesItem(QGraphicsItemGroup):
@@ -63,7 +63,7 @@ class AxesItem(QGraphicsItemGroup):
def __init__(
def __init__(
self,
self,
width: int,
width: int,
height: int,
height: float,
width_indent: float = SCHEDULE_INDENT,
width_indent: float = SCHEDULE_INDENT,
height_indent: float = SCHEDULE_INDENT,
height_indent: float = SCHEDULE_INDENT,
width_padding: float = 0.6,
width_padding: float = 0.6,
@@ -135,7 +135,7 @@ class AxesItem(QGraphicsItemGroup):
@@ -135,7 +135,7 @@ class AxesItem(QGraphicsItemGroup):
# self.update_axes(width = width)
# self.update_axes(width = width)
@property
@property
def height(self) -> int:
def height(self) -> float:
"""
"""
Get or set the current y-axis height. Setting the height to a new
Get or set the current y-axis height. Setting the height to a new
value will update the axes automatically.
value will update the axes automatically.
@@ -143,9 +143,10 @@ class AxesItem(QGraphicsItemGroup):
@@ -143,9 +143,10 @@ class AxesItem(QGraphicsItemGroup):
return self._height
return self._height
@height.setter
@height.setter
def height(self, height: int) -> None:
def height(self, height: float) -> None:
if self._height != height:
if self._height != height:
self.update_axes(height=height)
self._height = height
 
self._update_yaxis()
# @property
# @property
# def width_indent(self) -> float:
# def width_indent(self) -> float:
@@ -166,7 +167,7 @@ class AxesItem(QGraphicsItemGroup):
@@ -166,7 +167,7 @@ class AxesItem(QGraphicsItemGroup):
"""Register an object that receives events."""
"""Register an object that receives events."""
self._event_items.append(item)
self._event_items.append(item)
def set_height(self, height: int) -> "AxesItem":
def set_height(self, height: float) -> None:
# TODO: docstring
# TODO: docstring
if height < 0:
if height < 0:
raise ValueError(
raise ValueError(
@@ -175,7 +176,7 @@ class AxesItem(QGraphicsItemGroup):
@@ -175,7 +176,7 @@ class AxesItem(QGraphicsItemGroup):
self._height = height
self._height = height
self._update_yaxis()
self._update_yaxis()
def set_width(self, width: int) -> "AxesItem":
def set_width(self, width: int) -> None:
# TODO: docstring
# TODO: docstring
if width < 0:
if width < 0:
raise ValueError(
raise ValueError(
@@ -193,8 +194,6 @@ class AxesItem(QGraphicsItemGroup):
@@ -193,8 +194,6 @@ class AxesItem(QGraphicsItemGroup):
self._pop_x_tick()
self._pop_x_tick()
self._width -= 1
self._width -= 1
return self
def _pop_x_tick(self) -> None:
def _pop_x_tick(self) -> None:
# TODO: docstring
# TODO: docstring
Loading