Skip to content
Twisted and PyQt5 eventloop integration. Borrowed from https://github.com/nehbit/aether-public/blob/master/qt5reactor.py
Python
Branch: master
Clone or download
This branch is 5 commits ahead, 25 commits behind sunu:master.

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
twisted/plugins Move to qtpy Oct 29, 2018
.gitignore
.travis.yml
LICENSE Update copyright year Mar 21, 2018
README.rst
qreactor.py Move to qtpy Oct 29, 2018
setup.py Move to qtpy Oct 29, 2018
tests.py

README.rst

QReactor

Forked from qt5reactor which was forked from qt4reactor and now uses [qtpy](https://github.com/spyder-ide/qtpy) to provide to support both.

Using the QtReactor

Install using pip

pip install qt-reactor

Before running / importing any other Twisted code, invoke:

app = QApplication(sys.argv) # your code to init QtCore
from twisted.application import reactors
reactors.installReactor('qt')

or

app = QApplication(sys.argv) # your code to init QtCore
import qreactor
qreactor.install()

Testing

trial --reactor=qt5 [twisted] [twisted.test] [twisted.test.test_internet]

Make sure the plugin directory is in path or in the current directory for reactor discovery to work.

Testing on Python 3

trial does not work on Python3 yet. Use Twisted's Python 3 test runner instead.

Install the reactor before calling unittest.main().

import qreactor
qreactor.install()
unittest.main(...)
You can’t perform that action at this time.