'adding an Icon next to title doesn't work on Mac

I would like to add A LOGO next to Icon but it doesn't seem to work on Mac , any suggestions for [this]

1

code :

import sys
import os
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon


class Example(QWidget):
    def __init__(self):
        super(Example, self).__init__()
        self.initUI()

    def initUI(self):
        self.setGeometry(300, 300, 300, 220)
        self.setWindowTitle('Icon')
        self.setWindowIcon(QIcon('icon-cutout.png'))
        self.show()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    path = os.path.join(os.path.dirname(sys.modules[__name__].__file__), 'icon-cutout.png')
    app.setWindowIcon(QIcon(path))
    ex = Example()
    sys.exit(app.exec_())

it only appears in [here]

2



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source