zhiyiYo / PyQt-Fluent-Widgets

A fluent design widgets library based on C++ Qt/PyQt/PySide. Make Qt Great Again.
https://qfluentwidgets.com
GNU General Public License v3.0
5.61k stars 541 forks source link

[Bug]: scrollarea and its contents do not change color #713

Closed brandonzorn closed 9 months ago

brandonzorn commented 9 months ago

What happened?

scrollarea and its contents do not change color изображение

Operation System

Windows11 23H2

Python Version

3.11.7 64-bit

PyQt/PySide Version

6.4.2

PyQt/PySide-Fluent-Widgets Version

1.4.5

How to Reproduce?

изображение

Minimum code

import sys

from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication
from qfluentwidgets import setTheme, Theme, FluentWindow, ScrollArea, CardWidget, TitleLabel

class AppWindow(FluentWindow):
    def __init__(self):
        super().__init__()

        self.area = ScrollArea()
        self.card = CardWidget()
        self.card.setFixedSize(120, 120)
        self.lbl = TitleLabel("label", self.card)
        self.area.setWidget(self.card)
        self.stackedWidget.addWidget(self.area)

if __name__ == "__main__":
    QApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.RoundPreferFloor)
    setTheme(Theme.DARK)
    app = QApplication(sys.argv)
    window = AppWindow()
    window.show()
    sys.exit(app.exec())
zhiyiYo commented 9 months ago

You should set the style sheet of ScrollArea by yourself.