移动下位置
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Waiting to run

This commit is contained in:
2024-07-31 16:28:52 +08:00
parent 29b3196b9a
commit 86123c3358
8 changed files with 0 additions and 0 deletions

44
VM/novnc-client/main.py Normal file
View File

@@ -0,0 +1,44 @@
import sys
import logging
from PyQt5.QtWidgets import QApplication, QMainWindow
from qvncwidget import QVNCWidget
#logging.basicConfig(level=logging.DEBUG) # DEBUG及以上的日志信息都会显示
class Window(QMainWindow):
def __init__(self):
super(Window, self).__init__()
self.setWindowTitle("QVNCWidget")
self.vnc = QVNCWidget(
parent=self,
host="127.0.0.1", port=5905,
readOnly=False
)
self.setCentralWidget(self.vnc)
# you can disable mouse tracking if desired
self.vnc.setMouseTracking(True)
self.setAutoFillBackground(True)
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_())