Skip to content

Commit

Permalink
fix "Could not parse stylesheet of object QGroupBox..." error (#643)
Browse files Browse the repository at this point in the history
* fix "Could not parse stylesheet of object QGroupBox..." error

Signed-off-by: Martin <[email protected]>

* fix #596

Signed-off-by: Martin <[email protected]>

---------

Signed-off-by: Martin <[email protected]>
  • Loading branch information
Ho-Ro committed Jun 21, 2023
1 parent ce8a59d commit a8ffbc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/NanoVNASaver/Marker/Widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,8 @@ def setScale(self, scale):
self.label["actualfreq"].setMinimumWidth(int(100 * scale))
self.label["returnloss"].setMinimumWidth(int(80 * scale))
if self.coloredText:
color_string = QtCore.QVariant(self.color)
# color_string.convert(QtCore.QVariant.String)
self.group_box.setStyleSheet(
f"QGroupBox {{ color: {color_string.value()}; "
f"QGroupBox {{ color: {self.color.name()}; "
f"font-size: {self._size_str()}}};"
)
else:
Expand Down Expand Up @@ -233,11 +231,9 @@ def setColor(self, color):
p = self.btnColorPicker.palette()
p.setColor(QtGui.QPalette.ColorRole.ButtonText, self.color)
self.btnColorPicker.setPalette(p)
# TODO: fix Stylesheet
if self.coloredText:
color_string = QtCore.QVariant(color)
self.group_box.setStyleSheet(
f"QGroupBox {{ color: {color_string.value()}; "
f"QGroupBox {{ color: {color.name()}; "
f"font-size: {self._size_str()}}};"
)
else:
Expand Down
1 change: 1 addition & 0 deletions src/NanoVNASaver/Windows/DisplaySettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ def setColor(self):
logger.info("Invalid color")
return

setattr( Chart.color, attr, color ) # update trace color immediately
palette = sender.palette()
palette.setColor(QPalette.ColorRole.ButtonText, color)
sender.setPalette(palette)
Expand Down

0 comments on commit a8ffbc3

Please sign in to comment.