Anonymous asks
The notepad application example runs without problems on my Raspberry Pi. But the menu bar shows no icons. just blank rectangles. They do work if I click on them. What could be the problem?
Luca
Open the file notepad.py and go after this:
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
add the following lines:
icon = QIcon(os.path.join('images', 'blue-flolder-open-document.png'))
print("availableSizes:", icon.availableSizes())
the output on the terminal should be:
availableSizes: [PyQt5.QtCore.QSize(16, 16)]
if it is different, for example:
Create GUI Applications with Python & Qt6 by Martin Fitzpatrick — (PyQt6 Edition) The hands-on guide to making apps with Python — Over 15,000 copies sold!
availableSizes: []
try to replace all the occurrences of:
join('images',
to:
Purchasing Power Parity
Developers in [[ country ]] get [[ discount.discount_pc ]]% OFF on all books & courses with code [[ discount.coupon_code ]]join(path,
where path is the absolute path of your images folder for example:
path = '/home/USER_NAME/notepad/forum/images'
if the notepad folder is in the USER_NAME
folder.
PyQt/PySide 1:1 Coaching with Martin Fitzpatrick — Save yourself time and frustration. Get one on one help with your Python GUI projects. Working together with you I'll identify issues and suggest fixes, from bugs and usability to architecture and maintainability.