Skip to content

Commit

Permalink
fix: QSize need int, convert float to int (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
muyr authored Jun 21, 2024
1 parent 3dbf7f5 commit 3206ab4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dayu_widgets/carousel.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, pix_list, autoplay=True, width=500, height=500, parent=None):
hud_widget = QtWidgets.QWidget(self)
hud_widget.setLayout(self.navigate_lay)
hud_widget.setStyleSheet("background:transparent")
hud_widget.move(width / 2 - total_width / 2, height - 30)
hud_widget.move(int(width / 2 - total_width / 2), height - 30)

self.setFixedWidth(width + 2)
self.setFixedHeight(height + 2)
Expand Down
2 changes: 1 addition & 1 deletion dayu_widgets/progress_circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def set_dayu_width(self, value):
:return: None
"""
self._width = value
self.setFixedSize(QtCore.QSize(self._width * self._width_factor, self._width * self._height_factor))
self.setFixedSize(QtCore.QSize(int(self._width * self._width_factor), int(self._width * self._height_factor)))

def get_dayu_color(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion dayu_widgets/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def minimumSizeHint(self):
:return:
"""
height = self._dayu_size * 1.2
return QtCore.QSize(height, height / 2)
return QtCore.QSize(int(height), int(height / 2))

def get_dayu_size(self):
"""
Expand Down

0 comments on commit 3206ab4

Please sign in to comment.