コード例 #1
0
 def event(self,event):
     try:
         type = event.type()
         if type == QEvent.Gesture:
             return self.gestureEvent(event)
         if type == QEvent.TouchBegin:
             id = self.current_touch_Id = uuid.uuid1()
             t = event.touchPoints()[0]
             self.my_touch_points[id]={t.id():[t.pos()]}
             return True
         if type == QEvent.TouchUpdate:
             id = self.current_touch_Id
             for t in event.touchPoints():
                 if t.id() not in self.my_touch_points[id]:
                     self.my_touch_points[id][t.id()] = []
                 self.my_touch_points[id][t.id()].append(t.pos())
             return True
         if type == QEvent.TouchEnd:
             id = self.current_touch_Id
             for t in event.touchPoints():
                 self.my_touch_points[id][t.id()].append(t.pos())
             return True
         return QWidget.event(self, event)
     finally:
         self.update()
コード例 #2
0
    def event(self, event):
        if event.type() == QEvent.Gesture:
            print self.addr, event
            for g in event.gestures():
                if g.state() != Qt.GestureFinished:
                    continue
                if self.gesture_event(g):
                    return event.setAccepted(g, True)

        return QWidget.event(self, event)
コード例 #3
0
 def event(self, e):
     if e.type() != QEvent.ToolTip:
         return QWidget.event(self, e)
     for v in self.vertices.keys():
         rect = self.vertices[v]
         if rect.contains(e.pos()):
             txt = v.id
             for p in v.params.values():
                 txt += "\n" + p.name + "=" + p.value + " " + p.unit
             QToolTip.showText(e.globalPos(), txt)
             return True
     e.ignore()
     return True
コード例 #4
0
ファイル: grid1.py プロジェクト: estemenson/QT_Sandbox
 def event(self,event):
     try:
         type = event.type()
         if type == QEvent.Gesture:
             return self.gestureEvent(event)
         if type == QEvent.TouchBegin:
             self.current_touch_Id = uuid.uuid1()
             self.my_touch_points[self.current_touch_Id] =\
                                             [event.touchPoints()[0].pos()]
             return True
         if type == QEvent.TouchUpdate:
             self.my_touch_points[self.current_touch_Id].append(\
                     event.touchPoints()[++self.current_touch_index].pos())
             return True
         if type == QEvent.TouchEnd:
             self.my_touch_points[self.current_touch_Id].append(\
                     event.touchPoints()[++self.current_touch_index].pos())
             self.current_touch_index = 0
             return True
         return QWidget.event(self, event)
     finally:
         self.update()
コード例 #5
0
ファイル: infodock.py プロジェクト: pxp44/Roam
 def event(self, event):
     if event.type() == QEvent.Gesture:
         gesture = event.gesture(Qt.SwipeGesture)
         if gesture:
             self.pagenext()
     return QWidget.event(self, event)
コード例 #6
0
ファイル: lineedit.py プロジェクト: kevinlovesing/blink-qt
 def event(self, event):
     if event.type() == QEvent.LayoutRequest:
         self.sizeHintChanged.emit()
     return QWidget.event(self, event)
コード例 #7
0
ファイル: lineedit.py プロジェクト: webodf/blink-qt
 def event(self, event):
     if event.type() == QEvent.LayoutRequest:
         self.sizeHintChanged.emit()
     return QWidget.event(self, event)