Custom tittle bar (frameless) with QT-PyQt-PySide-Custom-Widgets and PyInstaller

269 Views Asked by At

Recently, I designed a Python application (PySide2 and QT-PyQt-PySide-Custom-Widgets) without a title bar. I achieved this by modifying the "QMainWindow" property in the "style.json" file as specified in the documentation:

"QMainWindow":[
    {
        "tittle":"MyApp",
        "icon":":/icons/Icons/activity.png",
        "frameless": true,
        "transluscentBg": true,
        "sizeGrip": "size_grip",
        "shadow":[
            {
                "color": "#fff",
                "blurRadius": 20,
                "xOffset": 0,
                "yOffset": 0,
                "centralWidget": "centralwidget"
            }
        ],
        "navigation":[
            {
                "minimize":"minimizeButton",
                "close": "quitButton",
                "restore":[
                    {
                        "buttonName": "maximizeButton",
                        "normalIcon": ":/icons/Icons/square.png",
                        "maximizedIcon": ":/icons/Icons/copy.png"
                    }
                ],
                "moveWindow": "titleBar",
                "tittleBar": "titleBar"
            }
        ]
    }
]

That works fine and I can see the window without the system's title bar.

enter image description here

However, when generating an executable with PyInstaller, the system's title bar reappears.

Pyinstaller myapp.py --onefile --windowed

enter image description here

Furthermore, the buttons on my custom title bar stops working and no longer responds to dragging the window.

0

There are 0 best solutions below