0% found this document useful (0 votes)
146 views

PySide Introduction

PySide is a Python binding for the Qt toolkit that allows developers to write GUI applications in Python. It provides full access to Qt classes and allows Python types to be used as parameters. PySide was created as an alternative to PyQt that is licensed under the more permissive LGPL instead of GPL. The document outlines Qt and PySide features, the differences between PyQt and PySide, and provides an example of using PySide to create a GUI application.

Uploaded by

austin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views

PySide Introduction

PySide is a Python binding for the Qt toolkit that allows developers to write GUI applications in Python. It provides full access to Qt classes and allows Python types to be used as parameters. PySide was created as an alternative to PyQt that is licensed under the more permissive LGPL instead of GPL. The document outlines Qt and PySide features, the differences between PyQt and PySide, and provides an example of using PySide to create a GUI application.

Uploaded by

austin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

PySide

overview
Marc Poinot
(ONERA/DSNA)
Outline

Quite short but practical overview

▶Qt
■ Toolkit overview
■ Model/View

▶PySide
■ pyQt4 vs PySide
■ Designer & Cython

■ Widget bindings

■ Class reuse

PySide - Introduction
ONERA/PySide-2/8
marc.poinot@onera.fr
Qt - Facts

▶Qt is cute
■ Cross platform application framework for GUI
X Window System, Windows...
■ C++ kernel + many bindings
Including Python
■ Release v5.3 05/2014
■ License GPL+LGPL+Commercial

Contact your own lawyer...

▶Components
■ Core: QtCore, QtGui...
■ Specialized: QtWebKit, QtSVG, QtSQL...

■ Tools : Creator, Designer...

PySide - Introduction
ONERA/PySide-3/8
marc.poinot@onera.fr
Qt - Example

PySide - Introduction
ONERA/PySide-4/8
marc.poinot@onera.fr
Python bindings

▶pyQt
■ The first to come
Some services have hard coded import PyQt4
■ GPL - Use only in free software

▶PySide
■ Some syntactic & behavior differences
■ LGPL - Use allowed in proprietary software

PySide overview hereafter mixes Qt/PySide features

PySide - Introduction
ONERA/PySide-5/8
marc.poinot@onera.fr
PySide - Facts

▶Full Python binding


■ Qt classes as Python classes
■ Python types as parameter types

▶Release 1.2.2 04/2014


▶Reference documentation

http://pyside.github.io/docs/pyside/

▶Production process
■ Uses many steps
■ Better with setup & source management

PySide - Introduction
ONERA/PySide-6/8
marc.poinot@onera.fr
PySide - Production process

W class Ui_W class WB(QWidget,Ui_W)


A.ui uic ui_A.pyx

Designer B.py

cython A.c A.so

A.rc rcc Res_rc.py

PySide - Introduction
ONERA/PySide-7/8
marc.poinot@onera.fr
PySide - Example
from PySide.QtCore import *
from PySide.QtGui  import *
from Gview import gui

import numpy as NPY
import vtk
from os.path import splitext

class GMain(QWidget,gui.Ui_controlWindow):
  # ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  def __init__(self):
     QWidget.__init__(self,None)
     self.setupUi(self)
     self.b_load.clicked.connect(self.b_loadOneFile)
     self.b_X.clicked.connect(self.b_xaxis)
  # ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  def b_xaxis(self,pos=None):
     if (self.c_mirror.isChecked()): self.setAxis(pos,­1)
     else: self.setAxis(pos,1)
  # ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  def closeEvent(self, event):
     print '*** Gview: close'
     event.accept()
PySide - Introduction
ONERA/PySide-8/8
marc.poinot@onera.fr
PySide
overview
Marc Poinot
(ONERA/DSNA)
Outline

Quite short but practical overview

▶Qt
■ Toolkit overview
■ Model/View

▶PySide
■ pyQt4 vs PySide
■ Designer & Cython
■ Widget bindings

■ Class reuse

PySide - Introduction
ONERA/PySide-2/8
marc.poinot@onera.fr
Qt - Facts

▶Qt is cute
■ Cross platform application framework for GUI
X Window System, Windows...
■ C++ kernel + many bindings
Including Python
■ Release v5.3 05/2014
■ License GPL+LGPL+Commercial

Contact your own lawyer...

▶Components
■ Core: QtCore, QtGui...
■ Specialized: QtWebKit, QtSVG, QtSQL...
■ Tools : Creator, Designer...

PySide - Introduction
ONERA/PySide-3/8
marc.poinot@onera.fr
Qt - Example

PySide - Introduction
ONERA/PySide-4/8
marc.poinot@onera.fr
Python bindings

▶pyQt
■ The first to come
Some services have hard coded import PyQt4
■ GPL - Use only in free software

▶PySide
■ Some syntactic & behavior differences
■ LGPL - Use allowed in proprietary software

PySide overview hereafter mixes Qt/PySide features

PySide - Introduction
ONERA/PySide-5/8
marc.poinot@onera.fr
PySide - Facts

▶Full Python binding


■ Qt classes as Python classes
■ Python types as parameter types

▶Release 1.2.2 04/2014


▶Reference documentation

http://pyside.github.io/docs/pyside/

▶Production process
■ Uses many steps
■ Better with setup & source management

PySide - Introduction
ONERA/PySide-6/8
marc.poinot@onera.fr
PySide - Production process

W class Ui_W class WB(QWidget,Ui_W)


A.ui uic ui_A.pyx

Designer B.py

cython A.c A.so

A.rc rcc Res_rc.py

PySide - Introduction
ONERA/PySide-7/8
marc.poinot@onera.fr
PySide - Example
from PySide.QtCore import *
from PySide.QtGui  import *
from Gview import gui

import numpy as NPY
import vtk
from os.path import splitext

class GMain(QWidget,gui.Ui_controlWindow):
  # ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  def __init__(self):
     QWidget.__init__(self,None)
     self.setupUi(self)
     self.b_load.clicked.connect(self.b_loadOneFile)
     self.b_X.clicked.connect(self.b_xaxis)
  # ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  def b_xaxis(self,pos=None):
     if (self.c_mirror.isChecked()): self.setAxis(pos,­1)
     else: self.setAxis(pos,1)
  # ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  def closeEvent(self, event):
     print '*** Gview: close'
     event.accept()
PySide - Introduction
ONERA/PySide-8/8
marc.poinot@onera.fr

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy