Python Forum
[PyQt] source code is not running in REDHAT 7 linux platform
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] source code is not running in REDHAT 7 linux platform
#1
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_())
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  running the code and seeing the GUI chriswrcg 1 761 May-19-2023, 04:49 PM
Last Post: deanhystad
  Updating/running code when path changes hermannhaf 14 2,994 Aug-05-2022, 09:37 PM
Last Post: woooee
  [PyQt] How to view GUI of a source code Chigoz 10 5,371 Mar-22-2019, 01:56 PM
Last Post: Axel_Erfurt
  Errors while running dash plotly code Nischitha 3 5,165 Aug-24-2017, 10:54 AM
Last Post: Larz60+
  popup message box code runs in Windows, but not in Linux Luke_Drillbrain 13 14,785 May-10-2017, 01:05 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020