Examples

If you downloaded a source archive or cloned pyQode from github, you will find a series of examples in the examples directory, at the root of the archive.

Note

All examples requires pyqode.qt to be installed.

Those examples show you how to force the use of one specific Qt bindings.

PyQt4

1
2
3
4
5
6
7
8
9
import logging
logging.basicConfig(level=logging.INFO)
import os
os.environ['QT_API'] = 'pyqt4'
from pyqode.qt import QtCore, QtGui, QtWidgets
print('Qt version:%s' % QtCore.__version__)
print(QtCore.QEvent)
print(QtGui.QPainter)
print(QtWidgets.QWidget)

PyQt5

1
2
3
4
5
6
7
8
9
import logging
logging.basicConfig(level=logging.INFO)
import os
os.environ['QT_API'] = 'pyqt5'
from pyqode.qt import QtCore, QtGui, QtWidgets
print('Qt version:%s' % QtCore.__version__)
print(QtCore.QEvent)
print(QtGui.QPainter)
print(QtWidgets.QWidget)

PySide

1
2
3
4
5
6
7
8
9
import logging
logging.basicConfig(level=logging.INFO)
import os
os.environ['QT_API'] = 'pyside'
from pyqode.qt import QtCore, QtGui, QtWidgets
print('Qt version:%s' % QtCore.__version__)
print(QtCore.QEvent)
print(QtGui.QPainter)
print(QtWidgets.QWidget)

Table Of Contents

Previous topic

pyqode.qt package