Skip to content

Commit

Permalink
Remove printing and comment out code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nginearing authored Nov 29, 2024
1 parent 31f3842 commit 9ac9720
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions tagstudio/src/qt/widgets/rating.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,21 @@ def __init__(self, title):
self.layout.addWidget(star)

Check failure on line 20 in tagstudio/src/qt/widgets/rating.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] tagstudio/src/qt/widgets/rating.py#L20

"Callable[[], QLayout]" has no attribute "addWidget" [attr-defined]
Raw output
/home/runner/work/TagStudioTesting/TagStudioTesting/tagstudio/src/qt/widgets/rating.py:20:13: error: "Callable[[], QLayout]" has no attribute "addWidget"  [attr-defined]
def set_rating(self, rating_index: int = None):
rating_index = rating_index if rating_index is None else self.stars.index(self.sender())

Check failure on line 22 in tagstudio/src/qt/widgets/rating.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] tagstudio/src/qt/widgets/rating.py#L22

Argument 1 to "index" of "list" has incompatible type "QObject"; expected "int" [arg-type]
Raw output
/home/runner/work/TagStudioTesting/TagStudioTesting/tagstudio/src/qt/widgets/rating.py:22:83: error: Argument 1 to "index" of "list" has incompatible type "QObject"; expected "int"  [arg-type]
print(rating_index)
for star in range(rating_index + 1):
self.stars[star].setStyleSheet("font-weight: bold; font-size: 20px;")

Check failure on line 24 in tagstudio/src/qt/widgets/rating.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] tagstudio/src/qt/widgets/rating.py#L24

"int" has no attribute "setStyleSheet" [attr-defined]
Raw output
/home/runner/work/TagStudioTesting/TagStudioTesting/tagstudio/src/qt/widgets/rating.py:24:13: error: "int" has no attribute "setStyleSheet"  [attr-defined]
for star in range(rating_index + 1, len(self.stars)):
self.stars[star].setStyleSheet("font-size: 30px;")

Check failure on line 26 in tagstudio/src/qt/widgets/rating.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] tagstudio/src/qt/widgets/rating.py#L26

"int" has no attribute "setStyleSheet" [attr-defined]
Raw output
/home/runner/work/TagStudioTesting/TagStudioTesting/tagstudio/src/qt/widgets/rating.py:26:13: error: "int" has no attribute "setStyleSheet"  [attr-defined]
rating = rating_index + 1
print(rating)
def modify_stars(self, totalstars):
for star in self.stars:
star.deleteLater()
self.stars.clear()
for star in range(totalstars):
star = QPushButton("⭐")
star.setCheckable(True)
star.clicked.connect(self.set_rating)
star.setStyleSheet("font-size: 30px;")
star.setFixedSize(24, 24)
self.stars.append(star)
self.layout.addWidget(star)
# def modify_stars(self, totalstars):
# for star in self.stars:
# star.deleteLater()
# self.stars.clear()
# for star in range(totalstars):
# star = QPushButton("⭐")
# star.setCheckable(True)
# star.clicked.connect(self.set_rating)
# star.setStyleSheet("font-size: 30px;")
# star.setFixedSize(24, 24)
# self.stars.append(star)
# self.layout.addWidget(star)
# Used to change amount of stars to a 10 star system

0 comments on commit 9ac9720

Please sign in to comment.