Skip to main content

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.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qvncwidget6 1.0.8
File Size Uploaded
qvncwidget6-1.0.8.tar.gz 25.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qvncwidget6 1.0.8
File Interpreter ABI Platform
qvncwidget6-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 53.7 kB

Release files / qvncwidget6-1.0.8.tar.gz

Download URL qvncwidget6-1.0.8.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
699e3cfd4954a39ceffc0a7960680ea05b8ae4c9f2f07b1f57b1591d6cf2d397
BLAKE2b-256 checksum
How to use checksums
0c0d34fa5d9c7f04fbc18fe1d8815781703c44162cb19d06c3ec4fbf57add878
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.8-py3-none-any.whl

Download URL qvncwidget6-1.0.8-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
660d9da6c05d51f0db98fb43fae26624214f93c8caf3f06347fb436a22ec7bad
BLAKE2b-256 checksum
How to use checksums
25ba9951cb2c24072a6217b8377a5c68a8002e55f36afc03bd26c36b5b05d709
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.14.3 Windows/11

Release history Release notifications | RSS feed

1.0.9

2 release files

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page