From b58d6d847bcc4194328052b0f2c3a6b9838865f0 Mon Sep 17 00:00:00 2001 From: mvincent Date: Wed, 13 Dec 2017 01:37:12 -0800 Subject: [PATCH 1/2] moved to qt5 --- rdpy/ui/{qt4.py => qt5.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename rdpy/ui/{qt4.py => qt5.py} (99%) diff --git a/rdpy/ui/qt4.py b/rdpy/ui/qt5.py similarity index 99% rename from rdpy/ui/qt4.py rename to rdpy/ui/qt5.py index 237f974..b9d2cec 100644 --- a/rdpy/ui/qt4.py +++ b/rdpy/ui/qt5.py @@ -23,7 +23,7 @@ QRemoteDesktop is a widget use for render in rdpy """ -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtCore, QtWidgets from rdpy.protocol.rfb.rfb import RFBClientObserver from rdpy.protocol.rdp.rdp import RDPClientObserver from rdpy.core.error import CallPureVirtualFuntion @@ -330,7 +330,7 @@ def onClose(self): #do something maybe a message -class QRemoteDesktop(QtGui.QWidget): +class QRemoteDesktop(QtWidgets.QWidget): """ @summary: Qt display widget """ From 03c396af84b2b59bfcdfb913a379906cc422e005 Mon Sep 17 00:00:00 2001 From: mvincent Date: Wed, 13 Dec 2017 01:37:46 -0800 Subject: [PATCH 2/2] moved to qt5 --- bin/rdpy-rdpclient.py | 14 +++++++------- bin/rdpy-rdpscreenshot.py | 12 ++++++------ bin/rdpy-rssplayer.py | 10 +++++----- bin/rdpy-vncclient.py | 14 +++++++------- bin/rdpy-vncscreenshot.py | 14 +++++++------- rdpy/ui/view.py | 2 +- setup.py | 2 +- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/bin/rdpy-rdpclient.py b/bin/rdpy-rdpclient.py index 660bfa4..3f3b97a 100755 --- a/bin/rdpy-rdpclient.py +++ b/bin/rdpy-rdpclient.py @@ -23,8 +23,8 @@ import sys, os, getopt, socket -from PyQt4 import QtGui, QtCore -from rdpy.ui.qt4 import RDPClientQt +from PyQt5 import QtGui, QtCore, QtWidgets +from rdpy.ui.qt5 import RDPClientQt from rdpy.protocol.rdp import rdp from rdpy.core.error import RDPSecurityNegoFail from rdpy.core import rss @@ -270,11 +270,11 @@ def help(): ip, port = args[0], "3389" #create application - app = QtGui.QApplication(sys.argv) + app = QtWidgets.QApplication(sys.argv) - #add qt4 reactor - import qt4reactor - qt4reactor.install() + #add qt5 reactor + import qt5reactor + qt5reactor.install() if fullscreen: width = QtGui.QDesktopWidget().screenGeometry().width() @@ -285,4 +285,4 @@ def help(): from twisted.internet import reactor reactor.connectTCP(ip, int(port), RDPClientQtFactory(width, height, username, password, domain, fullscreen, keyboardLayout, optimized, "nego", recodedPath)) reactor.runReturn() - app.exec_() \ No newline at end of file + app.exec_() diff --git a/bin/rdpy-rdpscreenshot.py b/bin/rdpy-rdpscreenshot.py index b87008a..a622e56 100755 --- a/bin/rdpy-rdpscreenshot.py +++ b/bin/rdpy-rdpscreenshot.py @@ -27,9 +27,9 @@ import os import sys -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtGui, QtWidgets from rdpy.protocol.rdp import rdp -from rdpy.ui.qt4 import RDPBitmapToQtImage +from rdpy.ui.qt5 import RDPBitmapToQtImage import rdpy.core.log as log from rdpy.core.error import RDPSecurityNegoFail from twisted.internet import task @@ -170,11 +170,11 @@ def main(width, height, path, timeout, hosts): @return: {list(tuple(ip, port, Failure instance)} list of connection state """ #create application - app = QtGui.QApplication(sys.argv) + app = QtWidgets.QApplication(sys.argv) - #add qt4 reactor - import qt4reactor - qt4reactor.install() + #add qt5 reactor + import qt5reactor + qt5reactor.install() from twisted.internet import reactor diff --git a/bin/rdpy-rssplayer.py b/bin/rdpy-rssplayer.py index 82f26a7..b6458ff 100755 --- a/bin/rdpy-rssplayer.py +++ b/bin/rdpy-rssplayer.py @@ -23,10 +23,10 @@ import sys, os, getopt, socket -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtCore, QtWidgets from rdpy.core import log, rss -from rdpy.ui.qt4 import QRemoteDesktop, RDPBitmapToQtImage +from rdpy.ui.qt5 import QRemoteDesktop, RDPBitmapToQtImage from rdpy.core.scancode import scancodeToChar log._LOG_LEVEL = log.Level.INFO @@ -46,7 +46,7 @@ def closeEvent(self, e): """ Not Handle """ QRemoteDesktop.__init__(self, width, height, RssAdaptor()) -class RssPlayerWindow(QtGui.QWidget): +class RssPlayerWindow(QtWidgets.QWidget): """ @summary: main window of rss player """ @@ -115,11 +115,11 @@ def loop(widget, rssFile, nextEvent): filepath = args[0] #create application - app = QtGui.QApplication(sys.argv) + app = QtWidgets.QApplication(sys.argv) mainWindow = RssPlayerWindow() mainWindow.show() rssFile = rss.createReader(filepath) start(mainWindow, rssFile) - sys.exit(app.exec_()) \ No newline at end of file + sys.exit(app.exec_()) diff --git a/bin/rdpy-vncclient.py b/bin/rdpy-vncclient.py index 5a6e6b8..b6ee799 100755 --- a/bin/rdpy-vncclient.py +++ b/bin/rdpy-vncclient.py @@ -23,8 +23,8 @@ """ import sys, os, getopt -from PyQt4 import QtGui -from rdpy.ui.qt4 import RFBClientQt +from PyQt5 import QtGui, QtWidgets +from rdpy.ui.qt5 import RFBClientQt from rdpy.protocol.rfb import rfb import rdpy.core.log as log @@ -98,13 +98,13 @@ def clientConnectionFailed(self, connector, reason): ip, port = args[0], "5900" #create application - app = QtGui.QApplication(sys.argv) + app = QtWidgets.QApplication(sys.argv) - #add qt4 reactor - import qt4reactor - qt4reactor.install() + #add qt5 reactor + import qt5reactor + qt5reactor.install() from twisted.internet import reactor reactor.connectTCP(ip, int(port), RFBClientQtFactory(password)) reactor.runReturn() - app.exec_() \ No newline at end of file + app.exec_() diff --git a/bin/rdpy-vncscreenshot.py b/bin/rdpy-vncscreenshot.py index a3cb7ec..3bc9deb 100755 --- a/bin/rdpy-vncscreenshot.py +++ b/bin/rdpy-vncscreenshot.py @@ -24,10 +24,10 @@ """ import sys, os, getopt -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtGui, QtWidgets from rdpy.protocol.rfb import rfb import rdpy.core.log as log -from rdpy.ui.qt4 import qtImageFormatFromRFBPixelFormat +from rdpy.ui.qt5 import qtImageFormatFromRFBPixelFormat from twisted.internet import task #set log level @@ -155,11 +155,11 @@ def help(): password = arg #create application - app = QtGui.QApplication(sys.argv) + app = QtWidgets.QApplication(sys.argv) - #add qt4 reactor - import qt4reactor - qt4reactor.install() + #add qt5 reactor + import qt5reactor + qt5reactor.install() from twisted.internet import reactor @@ -173,4 +173,4 @@ def help(): reactor.runReturn() - app.exec_() \ No newline at end of file + app.exec_() diff --git a/rdpy/ui/view.py b/rdpy/ui/view.py index 7976590..bc9f63c 100644 --- a/rdpy/ui/view.py +++ b/rdpy/ui/view.py @@ -21,7 +21,7 @@ Fake widget """ from rdpy.core.error import CallPureVirtualFuntion -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtCore class KeyCode(object): diff --git a/setup.py b/setup.py index d3136f2..224f161 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ 'twisted', 'pyopenssl', 'service_identity', - 'qt4reactor', + 'qt5reactor', 'rsa', 'pyasn1', ],