77
88import typing
99
10- from PySide6 .QtCore import QEvent , QSize , Qt , Signal
10+ from PySide6 .QtCore import QByteArray , QEvent , QSize , Qt , Signal
1111from PySide6 .QtGui import QIcon , QPixmap
1212from PySide6 .QtWidgets import (
1313 QFrame ,
@@ -168,10 +168,10 @@ def _create_arrow_button(self, direction: str, double: bool) -> QPushButton:
168168 """
169169 btn = QPushButton ()
170170 btn .setIcon (create_arrow_icon (direction , double ))
171- btn . setIconSize ( QSize ( * ICON_SIZES ["increment" ]) )
172- btn .setFixedSize (
173- BUTTON_SIZES [ "increment" ][ "width" ] , BUTTON_SIZES ["increment" ][ "height" ]
174- )
171+ icon_width , icon_height = typing . cast ( tuple [ int , int ], ICON_SIZES ["increment" ])
172+ btn .setIconSize ( QSize ( icon_width , icon_height ))
173+ increment_size = typing . cast ( dict [ str , int ] , BUTTON_SIZES ["increment" ])
174+ btn . setFixedSize ( increment_size [ "width" ], increment_size [ "height" ] )
175175 btn .setCursor (Qt .PointingHandCursor )
176176 btn .setStyleSheet (
177177 """
@@ -353,7 +353,7 @@ def _create_lr_arrow_icon(self, direction: str, double: bool) -> QIcon:
353353 """
354354
355355 pixmap = QPixmap ()
356- pixmap .loadFromData (bytes (svg , encoding = "utf-8" ), "SVG" )
356+ pixmap .loadFromData (QByteArray (svg . encode ( "utf-8" )) )
357357 return QIcon (pixmap )
358358
359359 def _create_x_icon (self ) -> QIcon :
@@ -366,7 +366,7 @@ def _create_x_icon(self) -> QIcon:
366366 </svg>
367367 """
368368 pixmap = QPixmap ()
369- pixmap .loadFromData (bytes (svg , encoding = "utf-8" ), "SVG" )
369+ pixmap .loadFromData (QByteArray (svg . encode ( "utf-8" )) )
370370 return QIcon (pixmap )
371371
372372 @typing .override
@@ -437,26 +437,22 @@ def _toggle_disabled(self) -> None:
437437 self .valueChanged .emit (self ._value )
438438
439439 # Public API (mirrors old InteractiveProgressBar)
440- @typing .override
441- def setMinimum (self , value : int ) -> None :
440+ def setMinimum (self , value : int ) -> None : # noqa: N802
442441 """Set the minimum internal value."""
443442 self ._minimum = int (value )
444443 self .progress_bar .setMinimum (int (value ))
445444
446- @typing .override
447- def setMaximum (self , value : int ) -> None :
445+ def setMaximum (self , value : int ) -> None : # noqa: N802
448446 """Set the maximum internal value."""
449447 self ._maximum = int (value )
450448 self .progress_bar .setMaximum (int (value ))
451449
452- @typing .override
453- def setValue (self , value : int ) -> None :
450+ def setValue (self , value : int ) -> None : # noqa: N802
454451 """Set the current value and update the progress bar."""
455452 self ._value = int (value )
456453 self .progress_bar .setValue (int (value ))
457454
458- @typing .override
459- def setFormat (self , format_str : str ) -> None :
455+ def setFormat (self , format_str : str ) -> None : # noqa: N802
460456 """Set the text format displayed on the progress bar."""
461457 self .progress_bar .setFormat (format_str )
462458
@@ -477,8 +473,7 @@ def value(self) -> int:
477473 """Return the current internal value."""
478474 return self ._value
479475
480- @typing .override
481- def isDisabled (self ) -> bool :
476+ def isDisabled (self ) -> bool : # noqa: N802
482477 """Return True if the widget is in disabled state."""
483478 return self ._disabled
484479
0 commit comments