Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GUI Programming with Python (PyQt 5)

GUI Programming with Python (PyQt 5)

PyQt 5 is the Python binding for Qt 5, developed by Riverbank Computing. This talk covers its very basics, and offers some extra information about general GUI programming.

Tzu-ping Chung

August 28, 2014
Tweet

More Decks by Tzu-ping Chung

Other Decks in Programming

Transcript

  1. Why • Native features • Nice Appearance • Easier access

    11 Why Not • Platform-specific • Difficult to learn • Deployment
  2. PyQt • Riverbank Computing • Qt 5 + Python 2/3

    • Qt 4 + Python 2 • GPL or commercial 17 PySide • Nokia → community • Qt + Python 2 • LGPL
  3. Demo #1 I’m using PyQt 5.3 on OS X. Source:

    https://gist.github.com/uranusjr/f55c8a5622c80c29732a
  4. Qt Widgets • Not covering QML today • Basic GUI

    components • “Top level” vs “Child widgets” 23
  5. Demo #2 Widgets within widgets are children of widgets. Source:

    https://gist.github.com/uranusjr/f55c8a5622c80c29732a
  6. Signals & Slots • When something happen, a signal is

    emitted • Slots can be connected to signals • When a signal emits, all slots connected to it are called 25
  7. Demo #4 Get your widgets in a row. Or a

    column. Or whatever you wish. Source: https://gist.github.com/uranusjr/f55c8a5622c80c29732a
  8. Qt Essentials • Basic modules • Core, Test • Modules

    based on other libraries • Multimedia, Network, SQL, WebKit • GUI modules • Widgets, Utility Widgets, QML, Quick 29
  9. How Does It Work? • Qt written in C++ •

    Compiled libraries • Bindings created by SIP • Python program 31
  10. PyQt • Riverbank Computing • Qt 5 + Python 2/3

    • Qt 4 + Python 2 • GPL or commercial 34 PySide • Nokia → community • Qt + Python 2 • LGPL Mostly compatible