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

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.9
File Size Uploaded
qvncwidget6-1.0.9.tar.gz 25.7 kB Details

Built distribution (wheel)

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

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

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

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