[PyQt] source code is not running in REDHAT 7 linux platform - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: [PyQt] source code is not running in REDHAT 7 linux platform (/thread-10494.html) |
source code is not running in REDHAT 7 linux platform - shridhara - May-23-2018 hi all, source code is already implemented and running in windows7 platform using python3.4 and 3.4 it is succesfully output generated but when i used the same sourcecode in REDHAT7.5 linux python platform it is only displaying filemenu and images but the Touch function is not working please guide me to resolve this issue sir Thanks shridhara s import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.uic import * from types import * from tkinter import * from tkinter import filedialog root = Tk() f1 = filedialog.askopenfilename(filetypes = (("how","*.py"),("ha","*.jpg"),("ha","*.png"),("all", "*.*"))) app = QApplication(sys.argv) w = loadUi("main1.ui") img = QImage(f1) painter = QPainter() scale = 1.0 angle = 1.0; transformHistory = QTransform() transformTotal = QTransform() startPoint = QPoint() def handleEvents(self, event): global scale, angle, transformHistory, transformTotal, startPoint if event.type() == QEvent.Gesture: g = event.gesture(Qt.PinchGesture) if g != None: upperLeft = self.mapToGlobal(QPoint()) scale = g.totalScaleFactor() angle = g.totalRotationAngle() centerPoint = g.centerPoint() print ( "centerPoint.x(), centerPoint.y()") if g.state() == Qt.GestureStarted: startPoint = g.centerPoint() transformTotal = transformHistory * QTransform().translate(centerPoint.x(), centerPoint.y()).rotate(angle).scale(scale, scale).translate(-startPoint.x(), -startPoint.y()) if g.state() == Qt.GestureFinished: transformHistory = transformTotal self.update() else: g = event.gesture(Qt.TapGesture) if g.state() == Qt.GestureFinished: print ("tap"), g.position() transformTotal = QTransform() transformHistory = QTransform() self.update() elif event.type() == QEvent.Paint: painter.begin(self) painter.setTransform(transformTotal) #painter.rotate(angle) #painter.scale(scale, scale) painter.drawImage(0, 0, img) painter.end() #print "hello" return True w.widget.event = MethodType(handleEvents, w.widget) w.widget.grabGesture(Qt.PinchGesture) w.widget.grabGesture(Qt.TapGesture) w.show() sys.exit(app.exec_()) |