Мой настоящий проект, над которым я работаю:

Я пробовал так, меняя цвет текста или все остальное работает нормально , но не фон.
Код: Выделить всё
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton
import sys
import qdarktheme
qss = """
QPushButton {
background-color: red;
color: white;
}
"""
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("My App")
self.button = QPushButton("Press Me")
self.setCentralWidget(self.button)
app = QApplication(sys.argv)
qdarktheme.setup_theme(additional_qss=qss)
window = MainWindow()
window.show()
app.exec()
Я знаю, что могу изменить каждую кнопку по отдельности с помощью
Код: Выделить всё
button.setStyleSheet('QPushButton {background-color: red}')
Подробнее здесь: https://stackoverflow.com/questions/786 ... tdarktheme
Мобильная версия