Feb-06-2019, 12:53 PM
(This post was last modified: Feb-06-2019, 01:03 PM by AlekseyPython.)
The Qt- framework was originally created for C++ and therefore contains pointers (both in the form of method parameters and in the form of return values). But there are no pointers in Python, so it is not clear how to write code using the PyQt library.
For example, in C++ I got the icon:
And in Python I try to do so:
For example, in C++ I got the icon:
Information = QIcon(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation));
And in Python I try to do so:
from PyQt5.QtGui import QIcon from PyQt5.Qtwidgets import QApplication, Qstyle Information = QIcon(QApplication.style().standardIcon(QStyle.SP_MessageBoxInformation)), but I get an error (just in the place where in C++ I turned to the pointer method!):
Error:Information = QtGui.QIcon (QApplication.style.)(standardIcon(qstyle.SP_MessageBox Information))
AttributeError:' NoneType ' object does not have 'standard' icon attribute
Probably there is some General rule of working with pointers, by which the PyQt library was created. How to work with them?