[PyQt] ***UNCHECKED*** Re: How to make menubar transparent?

Maurizio Berti maurizio.berti at gmail.com
Sun Mar 1 13:57:59 GMT 2020


Setting a transparent background through stylesheet should suffice:

class MyWindow(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        # ...
        self.setStyleSheet('''
            QMenuBar {
                background: transparent;
            }
        ''')


Il giorno dom 1 mar 2020 alle ore 02:23 Souvik Dutta <
souvik.viksou at outlook.com> ha scritto:

> I have a background and i want to see the background through the menubar.
>
> On Sun, 1 Mar, 2020, 3:44 am Maurizio Berti, <maurizio.berti at gmail.com>
> wrote:
>
>> What do you mean by "transparent"?
>> Do you want to see the background of the window or see "through" the
>> window (desktop, other windows, etc)?
>> In the first case, how did you set the background, and what type of
>> background is that?
>> Because if it's a plain color background (or a gradient), it *should* be
>> ok, but you've to ensure that text of menu items has enough contrast,
>> otherwise they wouldn't be readable.
>> This aspect is mostly important if you want to follow the second
>> approach, and I strongly advise you against it.
>> Also, what operating system(s) is your program aimed for?
>>
>> Maurizio
>>
>> Il giorno sab 29 feb 2020 alle ore 17:45 Souvik Dutta Chowdhury <
>> souvik.viksou at outlook.com> ha scritto:
>>
>>> The subject has it all.
>>> _______________________________________________
>>> PyQt mailing list    PyQt at riverbankcomputing.com
>>> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>>
>>
>>
>> --
>> È difficile avere una convinzione precisa quando si parla delle ragioni
>> del cuore. - "Sostiene Pereira", Antonio Tabucchi
>> http://www.jidesk.net
>>
>

-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200301/7109332f/attachment.html>


More information about the PyQt mailing list