Python PyQt5 Learning Note 1

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.