Untitled bar
    Phil Thompson 
    phil at riverbankcomputing.com
       
    Tue Feb  2 10:13:46 GMT 2021
    
    
  
On 02/02/2021 01:58, Nikola Tesla wrote:
> Hello, I created a form without a title bar and trying to redefine
> this method to be able to move my form with the left mouse does not
> work for me (I am using PyQt 6)
> 
> defmouseMoveEvent(self, event):
> if event.buttons() == Qt.LeftButton:
>             self.move(self.pos() + event.globalPos() - self.dragPos)
>             self.dragPos = event.globalPos()
>             event.accept()
> defmousePressEvent(self, event):
> if event.buttons() == Qt.LeftButton:
>             self.dragPos = event.globalPos()
>             event.accept()
"does not work for me" isn't the most helpful description. In any event, 
if you are using PyQt6 you will get attribute exceptions from the above.
Phil
    
    
More information about the PyQt
mailing list