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

SetStyleSheet a QMenu in QSystemTrayIcon does not work #9

Closed
algorys opened this issue Oct 18, 2016 · 2 comments
Closed

SetStyleSheet a QMenu in QSystemTrayIcon does not work #9

algorys opened this issue Oct 18, 2016 · 2 comments

Comments

@algorys
Copy link

algorys commented Oct 18, 2016

Hello,

I'm using PyQt5 to make an application with QSystemTrayIcon. Insise I've added a menu and I try to set style sheet but it does not work.

Here is a part of my code:

class AppIcon(QSystemTrayIcon):

    def __init__(self, icon, parent=None):
        QSystemTrayIcon.__init__(self, icon, parent)       
        self.menu = QMenu(parent)
        self.menu.setStyleSheet("background-color: blue")
        (...adding some QActions to menu...)
        self.setContextMenu(self.menu)

If I make self.menu.show, it show the menu with blue background but outside of QSystemTrayIcon. And I want to modify the menu inside the QSystemTrayIcon menu.

Is there a way to do that ?

PS : I'm under Ubuntu and install PyQt5 by pip, so not sure it's the best place to ask that ?

@baoboa
Copy link
Owner

baoboa commented Nov 17, 2016

this repo is independant from pip

contact -> Package Index Owner: PhilThompson

find on the pip page https://pypi.python.org/pypi/PyQt5/5.7

@baoboa baoboa closed this as completed Nov 17, 2016
@algorys
Copy link
Author

algorys commented Nov 17, 2016

Thanks for answer.

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

2 participants