Esempio n. 1
0
 def __init__(self, parent=None):
     """generate a fitting view with our favourite properties"""
     QGraphicsView.__init__(self, parent)
     self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     vpol = QSizePolicy()
     vpol.setHorizontalPolicy(QSizePolicy.Expanding)
     vpol.setVerticalPolicy(QSizePolicy.Expanding)
     self.setSizePolicy(vpol)
     self.setRenderHint(QPainter.Antialiasing)
     self.setRenderHint(QPainter.SmoothPixmapTransform)
     self.setStyleSheet('background: transparent')
     self.setFrameStyle(QFrame.NoFrame)
     self.tilePressed = None
     self.dragObject = None
     self.setFocus()
Esempio n. 2
0
File: board.py Progetto: KDE/kajongg
 def __init__(self, parent=None):
     """generate a fitting view with our favourite properties"""
     QGraphicsView.__init__(self, parent)
     self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     vpol = QSizePolicy()
     vpol.setHorizontalPolicy(QSizePolicy.Expanding)
     vpol.setVerticalPolicy(QSizePolicy.Expanding)
     self.setSizePolicy(vpol)
     self.setRenderHint(QPainter.Antialiasing)
     self.setRenderHint(QPainter.SmoothPixmapTransform)
     self.setStyleSheet('background: transparent')
     self.setFrameStyle(QFrame.NoFrame)
     self.tilePressed = None
     self.dragObject = None
     self.setFocus()
Esempio n. 3
0
 def mouseMoveEvent(self, event):
     """selects the correct uiTile"""
     tilePressed = self.tilePressed
     self.tilePressed = None
     if tilePressed:
         board = tilePressed.board
         if board and board.tileDragEnabled:
             self.dragObject = self.drag(tilePressed)
             self.dragObject.exec_(Qt.MoveAction)
             self.dragObject = None
             return
     return QGraphicsView.mouseMoveEvent(self, event)
Esempio n. 4
0
File: board.py Progetto: KDE/kajongg
 def mouseMoveEvent(self, event):
     """selects the correct uiTile"""
     tilePressed = self.tilePressed
     self.tilePressed = None
     if tilePressed:
         board = tilePressed.board
         if board and board.tileDragEnabled:
             self.dragObject = self.drag(tilePressed)
             self.dragObject.exec_(Qt.MoveAction)
             self.dragObject = None
             return
     return QGraphicsView.mouseMoveEvent(self, event)
Esempio n. 5
0
 def mouseReleaseEvent(self, event):
     """release self.tilePressed"""
     self.tilePressed = None
     return QGraphicsView.mouseReleaseEvent(self, event)
Esempio n. 6
0
File: board.py Progetto: KDE/kajongg
 def mouseReleaseEvent(self, event):
     """release self.tilePressed"""
     self.tilePressed = None
     return QGraphicsView.mouseReleaseEvent(self, event)