pyQVNCWidget
VNC Widget for Python using PyQt6
This is a fork of zocker-160/pyQVNCWidget, which updates the package to use PyQt6 instead of PyQt5.
How to install
pip3 install qvncwidget6
TODO from pyQVNCWidget
- Proper error handling
onFatalError - support for more than just RAW and RGB32 PIXEL_FORMATs
- support for compression
- implement rfb 3.7 and 3.8
- implement local and remote clipboard
Examples (see /examples folder)
import sys
from PyQt6.QtWidgets import QApplication, QMainWindow
from qvncwidget6 import QVNCWidget
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("QVNCWidget")
self.vnc = QVNCWidget(
parent=self,
host="127.0.0.1", port=5900,
password="1234",
readOnly=True #, autoResize = True
)
self.setCentralWidget(self.vnc)
# if you want to resize the window to the resolution of the
# VNC remote device screen, you can do this, but before you
# must specify `autoResize=True` when creating the instance
self.vnc.onResize.connect(self.resize)
self.vnc.start()
def closeEvent(self, ev):
self.vnc.stop()
return super().closeEvent(ev)
app = QApplication(sys.argv)
window = Window()
window.resize(800, 600)
window.show()
sys.exit(app.exec())
Example with widget input events
import sys
from PyQt6.QtWidgets import QApplication, QMainWindow
from qvncwidget6 import QVNCWidget
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("QVNCWidget")
self.vnc = QVNCWidget(
parent=self,
host="127.0.0.1", port=5900,
password="1234",
readOnly=False
)
self.setCentralWidget(self.vnc)
# we need to request focus otherwise we will not get keyboard input events
self.vnc.setFocus()
# you can disable mouse tracking if desired
self.vnc.setMouseTracking(False)
self.vnc.start()
def closeEvent(self, ev):
self.vnc.stop()
return super().closeEvent(ev)
app = QApplication(sys.argv)
window = Window()
window.resize(800, 600)
window.show()
sys.exit(app.exec())
Example with window input events
In this example we are passing input events from the window to the widget
import sys
from PyQt6.QtWidgets import QApplication, QMainWindow
from qvncwidget6 import QVNCWidget
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("QVNCWidget")
self.vnc = QVNCWidget(
parent=self,
host="127.0.0.1", port=5900,
password="1234",
readOnly=False
)
self.setCentralWidget(self.vnc)
# you can disable mouse tracking if desired
self.vnc.setMouseTracking(False)
self.vnc.start()
def keyPressEvent(self, ev):
self.vnc.keyPressEvent(ev)
return super().keyPressEvent(ev) # in case you need the signal somewhere else in the window
def keyReleaseEvent(self, ev):
self.vnc.keyReleaseEvent(ev)
return super().keyReleaseEvent(ev) # in case you need the signal somewhere else in the window
def closeEvent(self, ev):
self.vnc.stop()
return super().closeEvent(ev)
app = QApplication(sys.argv)
window = Window()
window.resize(800, 600)
window.show()
sys.exit(app.exec())
References
Metadata
Release files for qvncwidget6 1.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qvncwidget6-1.0.9.tar.gz | 25.7 kB | Without provenance | Details for qvncwidget6-1.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qvncwidget6-1.0.9-py3-none-any.whl | Python 3 | none | any | Details for qvncwidget6-1.0.9-py3-none-any.whl |
Total release size: 53.9 kB
Release files / qvncwidget6-1.0.9.tar.gz
| Download URL | qvncwidget6-1.0.9.tar.gz |
|---|---|
| Size | 25.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06e5c74357886022962f1bf3a8b9b0fbdd8484b69acb7c2de70c05ef4e79453f
|
|
BLAKE2b-256 checksum How to use checksums |
22d1f28a273cacfe84c1a98882bcba093cd7c67477727c93949f7d8e43cf6ce2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.14.3 Windows/11
|
Release files / qvncwidget6-1.0.9-py3-none-any.whl
| Download URL | qvncwidget6-1.0.9-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0dd6458ff962dbd0e61ebfa051755b59b584eb8f69175bdce8961e145e978d81
|
|
BLAKE2b-256 checksum How to use checksums |
eba9a3412929bf573f29518199516b1a3af84d43084900032a4bb323da8fb4c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.14.3 Windows/11
|
Security for qvncwidget6 1.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.