File: qt_interfaces.rst

package info (click to toggle)
pyqt5 5.7%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 19,844 kB
  • ctags: 5,974
  • sloc: python: 93,052; cpp: 20,268; xml: 282; makefile: 270; sh: 31
file content (17 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Support for Qt Interfaces
=========================

PyQt5 does not, generally, support defining a class that inherits from more
than one Qt class.  The exception is when inheriting from classes that Qt
defines as *interfaces*, for example
:class:`~PyQt5.QtGui.QTextObjectInterface`.

A Qt interface is an abstract class contains only pure virtual methods and is
used as a mixin with (normally) a :class:`~PyQt5.QtCore.QObject` sub-class.  It
is often used to define the interface that a plugin must implement.

Note that PyQt5 does not need an equivalent of Qt's ``Q_INTERFACES`` macro in
order to use an interface class.

The ``textobject.py`` example includedd with PyQt5 demonstrates the use of an
interface.