English 中文(简体)
PyQt5 - What’s New
  • 时间:2024-12-22

PyQt5 - What’s New


Previous Page Next Page  

PyQt5 API is not automatically compatible with earper versions. Hence, Python code involving PyQt4 modules should be upgraded manually by making relevant changes. In this chapter, main differences between PyQt4 and PyQt5 have been psted.

PyQt5 is not supported on versions of Python earper than v2.6.

PyQt5 doesn t support connect() method of QObject class for connection between signal and slot. Hence the usage can no more be implemented −


QObject.connect(widget, QtCore.SIGNAL(‘signalname’), slot_function)

Only the following syntax is defined −


widget.signal.connect(slot_function)

Classes defined in earper QtGui module have been distributed in QtGui, QtPrintSupport an QtWidgets modules.

In the new QFileDialog class, The getOpenFileNameAndFilter() method is replaced by getOpenFileName(), getOpenFileNamesAndFilter() by getOpenFileNames() and getSaveFileNameAndFilter() by getSaveFileName(). Older signatures of these methods also have changed.

PyQt5 doesn’t have provision to define a class that is sub-classed from more than one Qt class.

pyuic5 utipty (to generates Python code from Designer s XML file) does not support the --pyqt3-wrapper flag.

pyrcc5 does not support the -py2 and -py3 flags. The output of pyrcc5 is compatible with all versions of Python v2.6 onwards.

PyQt5 always invokes sip.setdestroyonexit() automatically and calls the C++ destructor of all wrapped instances that it owns.

Advertisements