ThibH
6/18/2018 - 5:37 PM

Draggable window / frame

Move window or frame with the mouse position

def mousePressEvent(self, event):
    self.offset = event.pos()

def mouseMoveEvent(self, event):
    x=event.globalX()
    y=event.globalY()
    x_w = self.offset.x()
    y_w = self.offset.y()
    self.move(x-x_w, y-y_w)