The difference between PYQT4 and PYQT5
The PYQT5 is not a backward compatible with PYQT4; There is several significant changes in PYQT5. However, it is not a very difficult to adjust older code to the new library. The differences is, among others, the following:
PYQT5 is not backwards compatible with PYQT4; This is some important change in PyQt5. However, migrating old code to a new version is not very difficult. The different points are as follows:
- The Python module has been rewritten. Some modules are discarded (
QtScript ), and some of the modules are split into sub-modules ( QtGui , QtWebKit ).
- New modules are introduced, included,
QtBluetooth QtPositioning , and Enginio .
- PYQT5 only supports the latest style of signal and slot notation. Calls to SIGNAL () and slot () will not be supported for long periods of time.
- PYQT5 does not support any APIs that are deprecated or canceled in the QT 5.0 release.
Example: Blank window
1 ImportSYS2 fromPyqt5.qtwidgetsImportqapplication, Qwidget3 4 5 if __name__=='__main__':6 7App =qapplication (SYS.ARGV)8 9W =Qwidget ()TenW.resize (250, 150) OneW.move (300, 300) AW.setwindowtitle (' Simple') - w.show () - theSys.exit (App.exec_ ())
Results:
Python PyQt5 Learning Note 1