SlideShare una empresa de Scribd logo
1 de 36
Descargar para leer sin conexión
PySide
Python Bindings for the Qt Framework
Marcelo Lira - setanta
March, 10th / Manaus - AM
Prologue
Who Am I?



 • Paid Open Source developer (lucky me!)
 • Computer Engineering Undergrad
 • I like Python but code mostly in C++
   (it’s the "binding developer paradox")
 • PySide / PyMaemo team member at INdT
Who We Are?



  • INdT - Instituto Nokia de Tecnologia
  • openBossa - INdT’s open source stream
  • Known projects: Canola, Carman, PyMaemo
  • Friends of Qt Development Frameworks / KDE
Qt Labs Americas




  • openBossa initiative
  • Development of Qt and KDE communities on the
   Americas

           http://qtlabs.openbossa.org
Python




  "Python is the best language ever invented!" -- me

               import antigravity
Qt Frameworks




      Cross-platform application development framework.

A little while after Nokia’s acquisition of Trolltech Qt started being
                  distributed under the LGPL license.
Today’s Topics



  • PySide
  • Binding Generation
  • Current Status
  • Future
PySide == Python + Qt




 PySide is how we call the Python bindings of the Qt
 Framework produced by INdT/openBossa/Qt Labs
   Americas and released under the LGPL license.
PySide Motivation

Python bindings for Qt under the LGPL license, aligned
            with the new licensing of Qt.



                       Make the Qt-Python bindings fit
                       hand-in-glove on the Maemo platform
                       and devices.



                Because we are the INdT.
PySide Overview




  • PySide: the thing that you import
  • libpyside: takes care of Qt signals/slots
  • libshiboken: helps interfacing Python with C++
Binding Assembly Line




  • Qt Headers: the basic information about Qt libraries comes
    from here.
  • Type System files: here the binding developer modifies the
    collected information to fit the Python language.
  • Handwritten code: code to handle the C++ idiosyncrasies
    that could appear.
And Why Not...?


  • Cython
  • ctypes
  • Swig
  • SIP
  • SMOKE
  • Boost.Python
  • My favorite technology...
Binding Generation
PySide Goals


Besides delivering LGPL Python bindings for Qt, our
other important goal was to deliver the complete
binding factory.
                    fishes + fishing rod
                             or
                PySide + Binding Generator

And we care about your fishing skills too, so we try to
document every part of the system.
Binding C++ libraries

Things one must take care in the binding business:
  • C++ object to Python wrapper association
  • Inheritance
  • Multiple inheritance and casting pointers
  • Implicit type conversions
  • Methods with multiple signatures
  • Protected methods
  • Function arguments that return values
  • Virtual method overrides
  • Object ownership
Shiboken


  • Shiboken is the binding generator used to create
    the PySide bindings.
  • It can generate bindings not only for Qt, but for
    any C++ library.
  • The word means nothing at all. I was trying to
    remember some name and instead of returning an
    empty string my brain made that up.
Shiboken


          Ok, if you really need a meaning...



 • Shi: Death
 • Bo: Something, someone or somewhere
 • Ken: Sword


                (Disclaimer: I don’t know Japanese.)
Binding Generator Pedigree
Boost.Python

The code created by the first Python binding generator used
Boost.Python as sugar coating over the C Python API.
In the beginning it was good because:
   • Quick start
   • Runtime speed
Nevertheless, there was a bad part that showed up later:
   • The size problem
     templates over templates over templates == huge   binaries
   • Lack of flexibility
     indirect access to the C Python API became a
     problem when flexibility was needed.
Binding Assembly Line (Again)




  • API Extractor: collects information from library headers, merges it with
    the modifications and handwritten code defined in the type system
    description.
  • Generator Runner: dynamic loader of generator front-ends.
  • Shiboken: generator front-end that outputs CPython source code.
libshiboken


  Bindings generated with Shiboken will also need
      libshiboken (which is LGPL, by the way).


                        libshiboken helps with:
                           • Association of C++ objects
                               with Python wrappers
                           •   Multiple inheritance
                           •   Implicit type conversions
                           •   Virtual method overrides
                           •   Object ownership
The Type System Description

<typesystem package="sample">
  <primitive-type name="int"/>
  <primitive-type name="Complex" target-lang-api-name="PyComplex">
    <conversion-rule file="complex_conversions.h"/>
    <include file-name="complex.h" location="global"/>
  </primitive-type>

 <namespace-type name="SampleNamespace"/>

 <value-type name="Number" />

  <value-type name="SimpleFile">
    <modify-function signature="open()">
      <modify-argument index="return">
        <remove-argument/>
      </modify-argument>
      <inject-code class="target" position="end" file="simplefile_glue.cpp"/>
    </modify-function>
  </value-type>
</typesystem>
Current Status
Getting Rid of Boost.Python




            Die Boost.Python!
                  Die!
Working Qt Modules


  • QtCore
  • QtGui
   (almost done)

  • QtNetwork and QtSvg
   (community effort! Go cgoncalves!)

  • QtWebkit
  • QtTest
And Now What?



  • Bug Fixing
    A couple of important generator bugs must be
    fixed.
  • Release
    We intend to release the Shiboken generated
    PySide in a month from now.
Future
Better Generation Process



Help others to help themselves.
  • A tool to quick start binding development.
  • A visual binding creation/editing tool.
    (Perhaps a QtCreator plugin.)
The Other Side


Our focus is on Maemo but there are other worlds we
care about.
  • Linux Distros: were taken care by the community
    (Cheers to odyx! And to chaz6 for the build patches.)

  • MacOS X: it needs a little love. Anyone with a good
    heart and a white laptop?
  • Microsoft Windows: some work is already done,
    but still needs love. Lovers?
Pythonization


         One of PySide requisites was to be
           API compatible with PyQt4.

  But we want to make PySide’s API more Pythonic.

Great, but... what makes something Pythonic?

                    What is good?
                     What is right?
                      What is real?
PSEPs



    PySide Enhancement Proposals
  • Inspired by Python’s PEPs.
  • Discussed with the community.
Questions?
Directions


                  www.pyside.org

      http://lists.openbossa.org/listinfo/pyside

                #pyside at Freenode

           http://qt.gitorious.org/pyside

               Marcelo Lira (setanta)
            marcelo.lira@openbossa.org
Thanks
  :)

Más contenido relacionado

La actualidad más candente

Being a Moby maintainer
Being a Moby maintainerBeing a Moby maintainer
Being a Moby maintainerAkihiro Suda
 
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...Igalia
 
FPGA Badge Hack: Linux on RISC-V
FPGA Badge Hack: Linux on RISC-VFPGA Badge Hack: Linux on RISC-V
FPGA Badge Hack: Linux on RISC-VDrew Fustini
 
Reaching the multimedia web from embedded platforms with WPEWebkit
Reaching the multimedia web from embedded platforms with WPEWebkitReaching the multimedia web from embedded platforms with WPEWebkit
Reaching the multimedia web from embedded platforms with WPEWebkitIgalia
 
Libnetwork updates
Libnetwork updatesLibnetwork updates
Libnetwork updatesMoby Project
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoIanDavidson56
 
Linux GUI Applications on Windows Subsystem for Linux
Linux GUI Applications on Windows Subsystem for LinuxLinux GUI Applications on Windows Subsystem for Linux
Linux GUI Applications on Windows Subsystem for LinuxEmbarcadero Technologies
 
How to create/improve OSS products and its community
How to create/improve OSS products and its communityHow to create/improve OSS products and its community
How to create/improve OSS products and its communitySATOSHI TAGOMORI
 
Linux on RISC-V (ELC 2020)
Linux on RISC-V (ELC 2020)Linux on RISC-V (ELC 2020)
Linux on RISC-V (ELC 2020)Drew Fustini
 
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...Igalia
 
Barcamp Hong Kong 2014 - Introduction to GIT
Barcamp Hong Kong 2014 - Introduction to GITBarcamp Hong Kong 2014 - Introduction to GIT
Barcamp Hong Kong 2014 - Introduction to GITWong Hoi Sing Edison
 
Introduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of PythonIntroduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of PythonPro Guide
 
Debian packaging talk, Pysheff sept 2012
Debian packaging talk, Pysheff sept 2012Debian packaging talk, Pysheff sept 2012
Debian packaging talk, Pysheff sept 2012takluyver
 
Parallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeParallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeAkihiro Suda
 

La actualidad más candente (20)

Being a Moby maintainer
Being a Moby maintainerBeing a Moby maintainer
Being a Moby maintainer
 
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
 
FPGA Badge Hack: Linux on RISC-V
FPGA Badge Hack: Linux on RISC-VFPGA Badge Hack: Linux on RISC-V
FPGA Badge Hack: Linux on RISC-V
 
Reaching the multimedia web from embedded platforms with WPEWebkit
Reaching the multimedia web from embedded platforms with WPEWebkitReaching the multimedia web from embedded platforms with WPEWebkit
Reaching the multimedia web from embedded platforms with WPEWebkit
 
Libnetwork updates
Libnetwork updatesLibnetwork updates
Libnetwork updates
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
 
Linux GUI Applications on Windows Subsystem for Linux
Linux GUI Applications on Windows Subsystem for LinuxLinux GUI Applications on Windows Subsystem for Linux
Linux GUI Applications on Windows Subsystem for Linux
 
How to create/improve OSS products and its community
How to create/improve OSS products and its communityHow to create/improve OSS products and its community
How to create/improve OSS products and its community
 
Master the Monorepo
Master the MonorepoMaster the Monorepo
Master the Monorepo
 
Linux on RISC-V (ELC 2020)
Linux on RISC-V (ELC 2020)Linux on RISC-V (ELC 2020)
Linux on RISC-V (ELC 2020)
 
How we do python
How we do pythonHow we do python
How we do python
 
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
 
Python workshop
Python workshopPython workshop
Python workshop
 
Barcamp Hong Kong 2014 - Introduction to GIT
Barcamp Hong Kong 2014 - Introduction to GITBarcamp Hong Kong 2014 - Introduction to GIT
Barcamp Hong Kong 2014 - Introduction to GIT
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Kivy for you
Kivy for youKivy for you
Kivy for you
 
Introduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of PythonIntroduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of Python
 
Debian packaging talk, Pysheff sept 2012
Debian packaging talk, Pysheff sept 2012Debian packaging talk, Pysheff sept 2012
Debian packaging talk, Pysheff sept 2012
 
Parallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeParallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-Mode
 
Bringing Tizen to a Raspberry Pi 2 Near You
Bringing Tizen to a Raspberry Pi 2 Near YouBringing Tizen to a Raspberry Pi 2 Near You
Bringing Tizen to a Raspberry Pi 2 Near You
 

Destacado

Slide PyQt versus Pyside
Slide PyQt versus PysideSlide PyQt versus Pyside
Slide PyQt versus PysideWill Filho
 
KQA Lone Wolf Finals - August 7th 2011
KQA Lone Wolf Finals - August 7th 2011KQA Lone Wolf Finals - August 7th 2011
KQA Lone Wolf Finals - August 7th 2011Ashwan
 
Qt Techday - João Pessoa
Qt Techday - João PessoaQt Techday - João Pessoa
Qt Techday - João PessoaOpenBossa
 
Desenvolvimento orientado a objetos com C++ e QT4 - Henrique Marks
Desenvolvimento orientado a objetos com C++ e QT4 - Henrique MarksDesenvolvimento orientado a objetos com C++ e QT4 - Henrique Marks
Desenvolvimento orientado a objetos com C++ e QT4 - Henrique MarksTchelinux
 
Algoritmo de Smith-Waterman
Algoritmo de Smith-WatermanAlgoritmo de Smith-Waterman
Algoritmo de Smith-WatermanMarcos Castro
 
Análise Assintótica
Análise AssintóticaAnálise Assintótica
Análise AssintóticaMarcos Castro
 
Busca em largura - BFS
Busca em largura - BFSBusca em largura - BFS
Busca em largura - BFSMarcos Castro
 
Programação dinâmica
Programação dinâmicaProgramação dinâmica
Programação dinâmicaMarcos Castro
 
Listas, tuplas, conjuntos e dicionários
Listas, tuplas, conjuntos e dicionáriosListas, tuplas, conjuntos e dicionários
Listas, tuplas, conjuntos e dicionáriosMarcos Castro
 
Problema do Caixeiro Viajante
Problema do Caixeiro ViajanteProblema do Caixeiro Viajante
Problema do Caixeiro ViajanteMarcos Castro
 
Algoritmo de Kosaraju
Algoritmo de KosarajuAlgoritmo de Kosaraju
Algoritmo de KosarajuMarcos Castro
 
Maratona de Programação com STL
Maratona de Programação com STLMaratona de Programação com STL
Maratona de Programação com STLMarcos Castro
 
Backtracking - Gerar todos os subconjuntos
Backtracking - Gerar todos os subconjuntosBacktracking - Gerar todos os subconjuntos
Backtracking - Gerar todos os subconjuntosMarcos Castro
 
Mágica com qt’s meta object system
Mágica com qt’s meta object systemMágica com qt’s meta object system
Mágica com qt’s meta object systemRodrigo Delduca
 
Construção de interfaces gráficas com Tkinter
Construção de interfaces gráficas com TkinterConstrução de interfaces gráficas com Tkinter
Construção de interfaces gráficas com TkinterMarcos Castro
 

Destacado (20)

Slide PyQt versus Pyside
Slide PyQt versus PysideSlide PyQt versus Pyside
Slide PyQt versus Pyside
 
KQA Lone Wolf Finals - August 7th 2011
KQA Lone Wolf Finals - August 7th 2011KQA Lone Wolf Finals - August 7th 2011
KQA Lone Wolf Finals - August 7th 2011
 
Qt Techday - João Pessoa
Qt Techday - João PessoaQt Techday - João Pessoa
Qt Techday - João Pessoa
 
Big data, e eu com isso?
Big data, e eu com isso?Big data, e eu com isso?
Big data, e eu com isso?
 
Dicas de otimização para aplicações Qt
Dicas de otimização para aplicações QtDicas de otimização para aplicações Qt
Dicas de otimização para aplicações Qt
 
Desenvolvimento orientado a objetos com C++ e QT4 - Henrique Marks
Desenvolvimento orientado a objetos com C++ e QT4 - Henrique MarksDesenvolvimento orientado a objetos com C++ e QT4 - Henrique Marks
Desenvolvimento orientado a objetos com C++ e QT4 - Henrique Marks
 
Algoritmo de Smith-Waterman
Algoritmo de Smith-WatermanAlgoritmo de Smith-Waterman
Algoritmo de Smith-Waterman
 
Introdução ao Qt
Introdução ao QtIntrodução ao Qt
Introdução ao Qt
 
Arquivos FASTQ
Arquivos FASTQArquivos FASTQ
Arquivos FASTQ
 
Análise Assintótica
Análise AssintóticaAnálise Assintótica
Análise Assintótica
 
Busca em largura - BFS
Busca em largura - BFSBusca em largura - BFS
Busca em largura - BFS
 
Programação dinâmica
Programação dinâmicaProgramação dinâmica
Programação dinâmica
 
Listas, tuplas, conjuntos e dicionários
Listas, tuplas, conjuntos e dicionáriosListas, tuplas, conjuntos e dicionários
Listas, tuplas, conjuntos e dicionários
 
Problema do Caixeiro Viajante
Problema do Caixeiro ViajanteProblema do Caixeiro Viajante
Problema do Caixeiro Viajante
 
Algoritmos gulosos
Algoritmos gulososAlgoritmos gulosos
Algoritmos gulosos
 
Algoritmo de Kosaraju
Algoritmo de KosarajuAlgoritmo de Kosaraju
Algoritmo de Kosaraju
 
Maratona de Programação com STL
Maratona de Programação com STLMaratona de Programação com STL
Maratona de Programação com STL
 
Backtracking - Gerar todos os subconjuntos
Backtracking - Gerar todos os subconjuntosBacktracking - Gerar todos os subconjuntos
Backtracking - Gerar todos os subconjuntos
 
Mágica com qt’s meta object system
Mágica com qt’s meta object systemMágica com qt’s meta object system
Mágica com qt’s meta object system
 
Construção de interfaces gráficas com Tkinter
Construção de interfaces gráficas com TkinterConstrução de interfaces gráficas com Tkinter
Construção de interfaces gráficas com Tkinter
 

Similar a PySide

PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsHenry Schreiner
 
Writing a Python C extension
Writing a Python C extensionWriting a Python C extension
Writing a Python C extensionSqreen
 
The Five Stages of Enterprise Jupyter Deployment
The Five Stages of Enterprise Jupyter DeploymentThe Five Stages of Enterprise Jupyter Deployment
The Five Stages of Enterprise Jupyter DeploymentFrederick Reiss
 
Keynote at Converge 2019
Keynote at Converge 2019Keynote at Converge 2019
Keynote at Converge 2019Travis Oliphant
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professionalzwheller
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Fwdays
 
AI & Machine Learning Pipelines with Knative
AI & Machine Learning Pipelines with KnativeAI & Machine Learning Pipelines with Knative
AI & Machine Learning Pipelines with KnativeAnimesh Singh
 
Python for security professionals by katoh jeremiah [py con ng 2018]
Python for security professionals by katoh jeremiah [py con ng 2018]Python for security professionals by katoh jeremiah [py con ng 2018]
Python for security professionals by katoh jeremiah [py con ng 2018]jerrykatoh
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 
Pythonic doesn't mean slow!
Pythonic doesn't mean slow!Pythonic doesn't mean slow!
Pythonic doesn't mean slow!Ronan Lamy
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unitmichaelaaron25322
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)p3castro
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Patrick Muehlbauer
 

Similar a PySide (20)

PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python Extensions
 
Writing a Python C extension
Writing a Python C extensionWriting a Python C extension
Writing a Python C extension
 
The Five Stages of Enterprise Jupyter Deployment
The Five Stages of Enterprise Jupyter DeploymentThe Five Stages of Enterprise Jupyter Deployment
The Five Stages of Enterprise Jupyter Deployment
 
Keynote at Converge 2019
Keynote at Converge 2019Keynote at Converge 2019
Keynote at Converge 2019
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professional
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"
 
AI & Machine Learning Pipelines with Knative
AI & Machine Learning Pipelines with KnativeAI & Machine Learning Pipelines with Knative
AI & Machine Learning Pipelines with Knative
 
Python for security professionals by katoh jeremiah [py con ng 2018]
Python for security professionals by katoh jeremiah [py con ng 2018]Python for security professionals by katoh jeremiah [py con ng 2018]
Python for security professionals by katoh jeremiah [py con ng 2018]
 
Koji and pulp
Koji and pulpKoji and pulp
Koji and pulp
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Numba lightning
Numba lightningNumba lightning
Numba lightning
 
Python for Delphi Developers - Part 2
Python for Delphi Developers - Part 2Python for Delphi Developers - Part 2
Python for Delphi Developers - Part 2
 
An Introduction to PyPy
An Introduction to PyPyAn Introduction to PyPy
An Introduction to PyPy
 
Intro to CakePHP
Intro to CakePHPIntro to CakePHP
Intro to CakePHP
 
Pythonic doesn't mean slow!
Pythonic doesn't mean slow!Pythonic doesn't mean slow!
Pythonic doesn't mean slow!
 
PyData Boston 2013
PyData Boston 2013PyData Boston 2013
PyData Boston 2013
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
Python Científico
Python CientíficoPython Científico
Python Científico
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018
 

Más de OpenBossa

Connecting Technology for Great Experiences - How does QML and Web fit together?
Connecting Technology for Great Experiences - How does QML and Web fit together?Connecting Technology for Great Experiences - How does QML and Web fit together?
Connecting Technology for Great Experiences - How does QML and Web fit together?OpenBossa
 
Intro to QML / Declarative UI
Intro to QML / Declarative UIIntro to QML / Declarative UI
Intro to QML / Declarative UIOpenBossa
 
Multi View Constructed Right
Multi View Constructed RightMulti View Constructed Right
Multi View Constructed RightOpenBossa
 
The Unusual Suspect: Layouts for sleeker KDE applications
The Unusual Suspect: Layouts for sleeker KDE applicationsThe Unusual Suspect: Layouts for sleeker KDE applications
The Unusual Suspect: Layouts for sleeker KDE applicationsOpenBossa
 
The Unusual Suspect: Layouts for sleeker KDE applications
The Unusual Suspect: Layouts for sleeker KDE applicationsThe Unusual Suspect: Layouts for sleeker KDE applications
The Unusual Suspect: Layouts for sleeker KDE applicationsOpenBossa
 
O que há de novo no Plasma Netbook?
O que há de novo no Plasma Netbook?O que há de novo no Plasma Netbook?
O que há de novo no Plasma Netbook?OpenBossa
 
What's up about Plasma-MID?
What's up about Plasma-MID?What's up about Plasma-MID?
What's up about Plasma-MID?OpenBossa
 
KDE in Your Life from Desktop to Pocket
KDE in Your Life from Desktop to PocketKDE in Your Life from Desktop to Pocket
KDE in Your Life from Desktop to PocketOpenBossa
 
Brasil, Open Source e o Mundo dos Negócios
Brasil, Open Source e o Mundo dos NegóciosBrasil, Open Source e o Mundo dos Negócios
Brasil, Open Source e o Mundo dos NegóciosOpenBossa
 
Negócios e Open Source
Negócios e Open SourceNegócios e Open Source
Negócios e Open SourceOpenBossa
 

Más de OpenBossa (11)

Connecting Technology for Great Experiences - How does QML and Web fit together?
Connecting Technology for Great Experiences - How does QML and Web fit together?Connecting Technology for Great Experiences - How does QML and Web fit together?
Connecting Technology for Great Experiences - How does QML and Web fit together?
 
Intro to QML / Declarative UI
Intro to QML / Declarative UIIntro to QML / Declarative UI
Intro to QML / Declarative UI
 
Multi View Constructed Right
Multi View Constructed RightMulti View Constructed Right
Multi View Constructed Right
 
The Unusual Suspect: Layouts for sleeker KDE applications
The Unusual Suspect: Layouts for sleeker KDE applicationsThe Unusual Suspect: Layouts for sleeker KDE applications
The Unusual Suspect: Layouts for sleeker KDE applications
 
The Unusual Suspect: Layouts for sleeker KDE applications
The Unusual Suspect: Layouts for sleeker KDE applicationsThe Unusual Suspect: Layouts for sleeker KDE applications
The Unusual Suspect: Layouts for sleeker KDE applications
 
Qt
QtQt
Qt
 
O que há de novo no Plasma Netbook?
O que há de novo no Plasma Netbook?O que há de novo no Plasma Netbook?
O que há de novo no Plasma Netbook?
 
What's up about Plasma-MID?
What's up about Plasma-MID?What's up about Plasma-MID?
What's up about Plasma-MID?
 
KDE in Your Life from Desktop to Pocket
KDE in Your Life from Desktop to PocketKDE in Your Life from Desktop to Pocket
KDE in Your Life from Desktop to Pocket
 
Brasil, Open Source e o Mundo dos Negócios
Brasil, Open Source e o Mundo dos NegóciosBrasil, Open Source e o Mundo dos Negócios
Brasil, Open Source e o Mundo dos Negócios
 
Negócios e Open Source
Negócios e Open SourceNegócios e Open Source
Negócios e Open Source
 

Último

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Último (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

PySide

  • 1. PySide Python Bindings for the Qt Framework Marcelo Lira - setanta March, 10th / Manaus - AM
  • 3. Who Am I? • Paid Open Source developer (lucky me!) • Computer Engineering Undergrad • I like Python but code mostly in C++ (it’s the "binding developer paradox") • PySide / PyMaemo team member at INdT
  • 4. Who We Are? • INdT - Instituto Nokia de Tecnologia • openBossa - INdT’s open source stream • Known projects: Canola, Carman, PyMaemo • Friends of Qt Development Frameworks / KDE
  • 5. Qt Labs Americas • openBossa initiative • Development of Qt and KDE communities on the Americas http://qtlabs.openbossa.org
  • 6. Python "Python is the best language ever invented!" -- me import antigravity
  • 7. Qt Frameworks Cross-platform application development framework. A little while after Nokia’s acquisition of Trolltech Qt started being distributed under the LGPL license.
  • 8. Today’s Topics • PySide • Binding Generation • Current Status • Future
  • 9.
  • 10. PySide == Python + Qt PySide is how we call the Python bindings of the Qt Framework produced by INdT/openBossa/Qt Labs Americas and released under the LGPL license.
  • 11. PySide Motivation Python bindings for Qt under the LGPL license, aligned with the new licensing of Qt. Make the Qt-Python bindings fit hand-in-glove on the Maemo platform and devices. Because we are the INdT.
  • 12. PySide Overview • PySide: the thing that you import • libpyside: takes care of Qt signals/slots • libshiboken: helps interfacing Python with C++
  • 13. Binding Assembly Line • Qt Headers: the basic information about Qt libraries comes from here. • Type System files: here the binding developer modifies the collected information to fit the Python language. • Handwritten code: code to handle the C++ idiosyncrasies that could appear.
  • 14. And Why Not...? • Cython • ctypes • Swig • SIP • SMOKE • Boost.Python • My favorite technology...
  • 16. PySide Goals Besides delivering LGPL Python bindings for Qt, our other important goal was to deliver the complete binding factory. fishes + fishing rod or PySide + Binding Generator And we care about your fishing skills too, so we try to document every part of the system.
  • 17. Binding C++ libraries Things one must take care in the binding business: • C++ object to Python wrapper association • Inheritance • Multiple inheritance and casting pointers • Implicit type conversions • Methods with multiple signatures • Protected methods • Function arguments that return values • Virtual method overrides • Object ownership
  • 18. Shiboken • Shiboken is the binding generator used to create the PySide bindings. • It can generate bindings not only for Qt, but for any C++ library. • The word means nothing at all. I was trying to remember some name and instead of returning an empty string my brain made that up.
  • 19. Shiboken Ok, if you really need a meaning... • Shi: Death • Bo: Something, someone or somewhere • Ken: Sword (Disclaimer: I don’t know Japanese.)
  • 21. Boost.Python The code created by the first Python binding generator used Boost.Python as sugar coating over the C Python API. In the beginning it was good because: • Quick start • Runtime speed Nevertheless, there was a bad part that showed up later: • The size problem templates over templates over templates == huge binaries • Lack of flexibility indirect access to the C Python API became a problem when flexibility was needed.
  • 22. Binding Assembly Line (Again) • API Extractor: collects information from library headers, merges it with the modifications and handwritten code defined in the type system description. • Generator Runner: dynamic loader of generator front-ends. • Shiboken: generator front-end that outputs CPython source code.
  • 23. libshiboken Bindings generated with Shiboken will also need libshiboken (which is LGPL, by the way). libshiboken helps with: • Association of C++ objects with Python wrappers • Multiple inheritance • Implicit type conversions • Virtual method overrides • Object ownership
  • 24. The Type System Description <typesystem package="sample"> <primitive-type name="int"/> <primitive-type name="Complex" target-lang-api-name="PyComplex"> <conversion-rule file="complex_conversions.h"/> <include file-name="complex.h" location="global"/> </primitive-type> <namespace-type name="SampleNamespace"/> <value-type name="Number" /> <value-type name="SimpleFile"> <modify-function signature="open()"> <modify-argument index="return"> <remove-argument/> </modify-argument> <inject-code class="target" position="end" file="simplefile_glue.cpp"/> </modify-function> </value-type> </typesystem>
  • 26. Getting Rid of Boost.Python Die Boost.Python! Die!
  • 27. Working Qt Modules • QtCore • QtGui (almost done) • QtNetwork and QtSvg (community effort! Go cgoncalves!) • QtWebkit • QtTest
  • 28. And Now What? • Bug Fixing A couple of important generator bugs must be fixed. • Release We intend to release the Shiboken generated PySide in a month from now.
  • 30. Better Generation Process Help others to help themselves. • A tool to quick start binding development. • A visual binding creation/editing tool. (Perhaps a QtCreator plugin.)
  • 31. The Other Side Our focus is on Maemo but there are other worlds we care about. • Linux Distros: were taken care by the community (Cheers to odyx! And to chaz6 for the build patches.) • MacOS X: it needs a little love. Anyone with a good heart and a white laptop? • Microsoft Windows: some work is already done, but still needs love. Lovers?
  • 32. Pythonization One of PySide requisites was to be API compatible with PyQt4. But we want to make PySide’s API more Pythonic. Great, but... what makes something Pythonic? What is good? What is right? What is real?
  • 33. PSEPs PySide Enhancement Proposals • Inspired by Python’s PEPs. • Discussed with the community.
  • 35. Directions www.pyside.org http://lists.openbossa.org/listinfo/pyside #pyside at Freenode http://qt.gitorious.org/pyside Marcelo Lira (setanta) marcelo.lira@openbossa.org