Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QT5 support #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions bin/rdpy-rdpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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_()
app.exec_()
12 changes: 6 additions & 6 deletions bin/rdpy-rdpscreenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions bin/rdpy-rssplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
"""
Expand Down Expand Up @@ -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_())
sys.exit(app.exec_())
14 changes: 7 additions & 7 deletions bin/rdpy-vncclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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_()
app.exec_()
14 changes: 7 additions & 7 deletions bin/rdpy-vncscreenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand All @@ -173,4 +173,4 @@ def help():


reactor.runReturn()
app.exec_()
app.exec_()
4 changes: 2 additions & 2 deletions rdpy/ui/qt4.py → rdpy/ui/qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -330,7 +330,7 @@ def onClose(self):
#do something maybe a message


class QRemoteDesktop(QtGui.QWidget):
class QRemoteDesktop(QtWidgets.QWidget):
"""
@summary: Qt display widget
"""
Expand Down
2 changes: 1 addition & 1 deletion rdpy/ui/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'twisted',
'pyopenssl',
'service_identity',
'qt4reactor',
'qt5reactor',
'rsa',
'pyasn1',
],
Expand Down