I just installed python3 (3.5.2) and Pyqt5(5.8.2) and i am following this tutorial to learn and make an GUI:
http://zetcode.com/gui/pyqt5/firstprograms/
I'm trying to run 2nd example but program is given an error (which also happened on the 1st one, but since it had no image i took no notice) which is the following:
QApplication: invalid style override passed, ignoring it. No XVisualInfo for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(SingleBuffer), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile)) Falling back to using screens root_visual.
what is the meaning of this? Am i missing some packages?
I installed pyqt first with command,
sudo -H pip3 install PyQt5 but python3 was not acnkoledging its existence so i searched the apt ubuntu repos and installed with sudo apt install python3-PyQt5
I also tried to reference the image by full path /foo/bar/image.png and nothing
What is the problem?
EDIT - 1
The code that i am using is from example 2:
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ ZetCode PyQt5 tutorial This example shows an icon in the titlebar of the window. author: Jan Bodnar website: zetcode.com last edited: January 2015 """ import sys import os from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QIcon base_dir = os.path.dirname(os.path.abspath(__file__)) os.chdir(base_dir) class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.setGeometry(300, 300, 300, 220) self.setWindowTitle('Icon') self.setWindowIcon(QIcon('image.png')) self.show() if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())
After your post i rechecked all my packages (unistalled all pyqt and installed again). The error is slightly different but the result is the same
python3 example_02.py QApplication: invalid style override passed, ignoring it.