Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The font or background color of the table widget does not change. #55

Open
cazador4980 opened this issue Mar 7, 2022 · 2 comments
Open

Comments

@cazador4980
Copy link

If the theme is not applied, the code below will be applied.
'setForeground(0, 0, 255)'
It does not apply when the theme is applied.
How can I solve this problem?

@JohanRain
Copy link

the same problem

@YeisonCardona
Copy link
Contributor

Hi @cazador4980 and @FoolAsphel

If you mean about change theme features, it can be done by changing the stylesheet and add custom-stylesheets.

After apply_stylesheet()

stylesheet = app.styleSheet()
app.setStyleSheet(stylesheet + "QTableView {background-color: #0000ff;}")

The stylesheet can also be changed on runtime by:

stylesheet = app.styleSheet()
with open('custom.css') as file:
    app.setStyleSheet(stylesheet + file.read().format(**os.environ))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants