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

Tooltip background color #239

Open
bhowiebkr opened this issue Mar 11, 2023 · 3 comments
Open

Tooltip background color #239

bhowiebkr opened this issue Mar 11, 2023 · 3 comments

Comments

@bhowiebkr
Copy link

bhowiebkr commented Mar 11, 2023

I'm finding that tooltips are showing up incorrectly. Text color appears to be correct but the background is white making it impossible to see. See attached image
tooltip_color_issue

This is in Windows 11 and PySide6

@bhowiebkr
Copy link
Author

bhowiebkr commented Mar 11, 2023

This appears to be an issue with QT or windows 11 itself. With the code below the red background in the stylesheet doesn't change.

image

from PySide6.QtWidgets import QApplication, QWidget, QToolTip, QPushButton

app = QApplication([])

# Set stylesheet to customize tooltip colors
app.setStyleSheet("QToolTip { background-color: red; color: blue; }")

# Create a widget with a button that has a tooltip
widget = QWidget()
button = QPushButton("button", widget)
button.setToolTip("This is a custom tooltip")

widget.show()
app.exec()

To get around this for now, I'm setting the text in the tool tip white so the tips are visible

qdarktheme.setup_theme(additional_qss="QToolTip {color: black;}")

@r-almendarez
Copy link

Just ran into this issue and accidentally discovered a fix. To get the theme to work properly on Windows 11, add an additional qss that removes the border:
qdarktheme.setup_theme(additional_qss="QToolTip { border: 0px; }")

For whatever reason, this works and allows QT to render the tool boxes correctly

@SanPen
Copy link

SanPen commented Mar 27, 2024

This is a note for the future me:

additional_qss="QToolTip {color: white; background-color: black; border: 0px; }"

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