fix "Could not parse stylesheet of object QGroupBox..." error (#643)

* fix "Could not parse stylesheet of object QGroupBox..." error

Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>

* fix https://github.com/NanoVNA-Saver/nanovna-saver/issues/596

Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>

---------

Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
pull/647/head
Martin 2023-06-21 14:08:19 +02:00 zatwierdzone przez GitHub
rodzic ce8a59d478
commit a8ffbc3aee
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 3 dodań i 6 usunięć

Wyświetl plik

@ -183,10 +183,8 @@ class Marker(QtCore.QObject, Value):
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:
@ -233,11 +231,9 @@ class Marker(QtCore.QObject, Value):
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:

Wyświetl plik

@ -551,6 +551,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
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)