# pyQVNCWidget
VNC Widget for Python using PyQt5
## How to install
```bash
pip3 install qvncwidget
```
### TODO:
- 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)
```python
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from qvncwidget import QVNCWidget
class Window(QMainWindow):
def __init__(self):
super(Window, self).__init__()
self.setWindowTitle("QVNCWidget")
self.vnc = QVNCWidget(
parent=self,
host="127.0.0.1", port=5900,
password="1234",
readOnly=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
self.vnc.onInitialResize.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
```python
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from qvncwidget import QVNCWidget
class Window(QMainWindow):
def __init__(self):
super(Window, self).__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
```python
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from qvncwidget import QVNCWidget
class Window(QMainWindow):
def __init__(self):
super(Window, self).__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
- https://datatracker.ietf.org/doc/html/rfc6143
- https://vncdotool.readthedocs.io/en/0.8.0/rfbproto.html?highlight=import#string-encodings
Raw data
{
"_id": null,
"home_page": "https://github.com/zocker-160/pyQVNCWidget",
"name": "QVncWidget",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": null,
"keywords": null,
"author": "zocker_160",
"author_email": "zocker1600@posteo.net",
"download_url": "https://files.pythonhosted.org/packages/29/09/addfdb9b20e58233dc7c97be26b0065729f1048d9c9ff0680b900935a4ec/qvncwidget-0.3.5.tar.gz",
"platform": null,
"description": "# pyQVNCWidget\nVNC Widget for Python using PyQt5\n\n## How to install\n\n```bash\npip3 install qvncwidget\n```\n\n### TODO:\n- Proper error handling `onFatalError`\n- support for more than just RAW and RGB32 PIXEL_FORMATs\n- support for compression\n- implement rfb 3.7 and 3.8\n- implement local and remote clipboard\n\n## Examples (see /examples folder)\n\n```python\nimport sys\nfrom PyQt5.QtWidgets import QApplication, QMainWindow\nfrom qvncwidget import QVNCWidget\n\nclass Window(QMainWindow):\n def __init__(self):\n super(Window, self).__init__()\n\n self.setWindowTitle(\"QVNCWidget\")\n\n self.vnc = QVNCWidget(\n parent=self,\n host=\"127.0.0.1\", port=5900,\n password=\"1234\",\n readOnly=True\n )\n\n self.setCentralWidget(self.vnc)\n\n # if you want to resize the window to the resolution of the \n # VNC remote device screen, you can do this\n self.vnc.onInitialResize.connect(self.resize)\n\n self.vnc.start()\n\n def closeEvent(self, ev):\n self.vnc.stop()\n return super().closeEvent(ev)\n\napp = QApplication(sys.argv)\nwindow = Window()\nwindow.resize(800, 600)\nwindow.show()\n\nsys.exit(app.exec_())\n```\n\n### Example with widget input events\n\n```python\nimport sys\nfrom PyQt5.QtWidgets import QApplication, QMainWindow\nfrom qvncwidget import QVNCWidget\n\nclass Window(QMainWindow):\n def __init__(self):\n super(Window, self).__init__()\n\n self.setWindowTitle(\"QVNCWidget\")\n\n self.vnc = QVNCWidget(\n parent=self,\n host=\"127.0.0.1\", port=5900,\n password=\"1234\",\n readOnly=False\n )\n\n self.setCentralWidget(self.vnc)\n # we need to request focus otherwise we will not get keyboard input events\n self.vnc.setFocus()\n\n # you can disable mouse tracking if desired\n self.vnc.setMouseTracking(False)\n\n self.vnc.start()\n\n def closeEvent(self, ev):\n self.vnc.stop()\n return super().closeEvent(ev)\n\napp = QApplication(sys.argv)\nwindow = Window()\nwindow.resize(800, 600)\nwindow.show()\n\nsys.exit(app.exec_())\n```\n\n### Example with window input events\n\nIn this example we are passing input events from the window to the widget\n\n```python\nimport sys\nfrom PyQt5.QtWidgets import QApplication, QMainWindow\nfrom qvncwidget import QVNCWidget\n\nclass Window(QMainWindow):\n def __init__(self):\n super(Window, self).__init__()\n\n self.setWindowTitle(\"QVNCWidget\")\n\n self.vnc = QVNCWidget(\n parent=self,\n host=\"127.0.0.1\", port=5900,\n password=\"1234\",\n readOnly=False\n )\n\n self.setCentralWidget(self.vnc)\n\n # you can disable mouse tracking if desired\n self.vnc.setMouseTracking(False)\n\n self.vnc.start()\n\n def keyPressEvent(self, ev):\n self.vnc.keyPressEvent(ev)\n return super().keyPressEvent(ev) # in case you need the signal somewhere else in the window\n\n def keyReleaseEvent(self, ev):\n self.vnc.keyReleaseEvent(ev)\n return super().keyReleaseEvent(ev) # in case you need the signal somewhere else in the window\n\n def closeEvent(self, ev):\n self.vnc.stop()\n return super().closeEvent(ev)\n\napp = QApplication(sys.argv)\nwindow = Window()\nwindow.resize(800, 600)\nwindow.show()\n\nsys.exit(app.exec_())\n```\n\n## References\n\n- https://datatracker.ietf.org/doc/html/rfc6143\n- https://vncdotool.readthedocs.io/en/0.8.0/rfbproto.html?highlight=import#string-encodings\n",
"bugtrack_url": null,
"license": "GPLv3+",
"summary": "VNC QT Widget for Python using PyQt5",
"version": "0.3.5",
"project_urls": {
"Homepage": "https://github.com/zocker-160/pyQVNCWidget",
"Repository": "https://github.com/zocker-160/pyQVNCWidget"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "673ade895aa226b8e56b0c8d734e0b8103cf7f8737cd947296528ccb79978fdf",
"md5": "79f3bbbcdbc2ee7873793dd124f275db",
"sha256": "c3d1bf865b728977d4cb815d2d908a454cf4d6f8f88378093b885bc1530e8073"
},
"downloads": -1,
"filename": "qvncwidget-0.3.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "79f3bbbcdbc2ee7873793dd124f275db",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 26667,
"upload_time": "2024-11-19T16:34:06",
"upload_time_iso_8601": "2024-11-19T16:34:06.058548Z",
"url": "https://files.pythonhosted.org/packages/67/3a/de895aa226b8e56b0c8d734e0b8103cf7f8737cd947296528ccb79978fdf/qvncwidget-0.3.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2909addfdb9b20e58233dc7c97be26b0065729f1048d9c9ff0680b900935a4ec",
"md5": "a3ffaaccdbb18cd72cb15ea859a3128f",
"sha256": "d2bf7d1b68d4fa9af5b5271dc395c06c90d1db0bc43a76ef45ffaa14cf51e18f"
},
"downloads": -1,
"filename": "qvncwidget-0.3.5.tar.gz",
"has_sig": false,
"md5_digest": "a3ffaaccdbb18cd72cb15ea859a3128f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 25434,
"upload_time": "2024-11-19T16:34:07",
"upload_time_iso_8601": "2024-11-19T16:34:07.354086Z",
"url": "https://files.pythonhosted.org/packages/29/09/addfdb9b20e58233dc7c97be26b0065729f1048d9c9ff0680b900935a4ec/qvncwidget-0.3.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-19 16:34:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zocker-160",
"github_project": "pyQVNCWidget",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "qvncwidget"
}