<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  </head>
  <body>
    <p>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)</p>
    <div style="color: #92cef1;background-color: #26323b;font-family: 'Fira Code Retina', Consolas, 'Courier New', monospace;font-weight: normal;font-size: 26px;line-height: 35px;white-space: pre;">
<div><span style="color: #92cef1;">    </span><span style="color: #e74c3c;">def</span><span style="color: #92cef1;"> </span><span style="color: #74ed78;">mouseMoveEvent</span><span style="color: #92cef1;">(</span><span style="color: #fd971f;">self</span><span style="color: #92cef1;">, </span><span style="color: #fd971f;">event</span><span style="color: #92cef1;">):</span></div><div><span style="color: #92cef1;">        </span><span style="color: #ea6442;">if</span><span style="color: #92cef1;"> event.buttons() </span><span style="color: #ea6442;">==</span><span style="color: #92cef1;"> Qt.LeftButton:</span></div><div><span style="color: #92cef1;">            self.move(self.pos() </span><span style="color: #ea6442;">+</span><span style="color: #92cef1;"> event.globalPos() </span><span style="color: #ea6442;">-</span><span style="color: #92cef1;"> self.dragPos)</span></div><div><span style="color: #92cef1;">            self.dragPos </span><span style="color: #ea6442;">=</span><span style="color: #92cef1;"> event.globalPos()</span></div><div><span style="color: #92cef1;">            event.accept()</span></div>

<div><span style="color: #92cef1;">    </span><span style="color: #e74c3c;">def</span><span style="color: #92cef1;"> </span><span style="color: #74ed78;">mousePressEvent</span><span style="color: #92cef1;">(</span><span style="color: #fd971f;">self</span><span style="color: #92cef1;">, </span><span style="color: #fd971f;">event</span><span style="color: #92cef1;">):</span></div><div><span style="color: #92cef1;">        </span><span style="color: #ea6442;">if</span><span style="color: #92cef1;"> event.buttons() </span><span style="color: #ea6442;">==</span><span style="color: #92cef1;"> Qt.LeftButton:</span></div><div><span style="color: #92cef1;">            self.dragPos </span><span style="color: #ea6442;">=</span><span style="color: #92cef1;"> event.globalPos()</span></div><div><span style="color: #92cef1;">            event.accept()</span></div></div>
  </body>
</html>