Check out Kite (free AI Coding Assistant) → Link



Buy Me a Coffee? Your support is much appreciated!

Source Code:  

import sys
from PyQt5.QtWidgets import QApplication, QWidget, \
                            QHBoxLayout, QVBoxLayout
from PyQt5.QtCore import Qt, QPoint

class MyApp(QWidget):
    def __init__(self):
        super().__init__()
        self.window_width, self.window_height = 1200, 800
        self.setMinimumSize(self.window_width, self.window_height)
        # self.setWindowFlags(Qt.)
        self.setStyleSheet('''
            QWidget {
                font-size: 30px;
            }
        ''')        

        self.layout = QVBoxLayout()
        self.setLayout(self.layout)

    def mousePressEvent(self, event):
        self.oldPos = event.globalPos()

    def mouseMoveEvent(self, event):
       delta = QPoint(event.globalPos() - self.oldPos)
       self.move(self.x() + delta.x(), self.y() + delta.y())
       self.oldPos = event.globalPos()


if __name__ == '__main__':
    # don't auto scale when drag app to a different monitor.
    # QApplication.setAttribute(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)
    
    app = QApplication(sys.argv)
    
    myApp = MyApp()
    myApp.show()

    try:
        sys.exit(app.exec_())
    except SystemExit:
        print('Closing Window...')