a-burlakov / melinas-fingers

🖐⌨ Hotkey tool to improve your Elden Ring experience. Desktop app made with PyQt.
MIT License
69 stars 1 forks source link

Curious about compiling #3

Closed God-damnit-all closed 2 years ago

God-damnit-all commented 2 years ago

What do you do to compile this PyQt project into an exe? I've never done it before so I'm wondering how it's done.

a-burlakov commented 2 years ago

I use the first thing I googled actually: PyInstaller.

To turn this project to .exe I just put this into terminal pyinstaller src\main.py -F -w -i 'C:\PythonProjects\EldenRing-MelinasFingers\src\images\icon.ico'

God-damnit-all commented 2 years ago

I use the first thing I googled actually: PyInstaller.

To turn this project to .exe I just put this into terminal pyinstaller src\main.py -F -w -i 'C:\PythonProjects\EldenRing-MelinasFingers\src\images\icon.ico'

I'm surprised that's all there is to it, how did you design the UI? I figured Qt Creator would be involved. I tried using it but I couldn't figure out how to import the files properly.

a-burlakov commented 2 years ago

Well, it actually simple:

  1. I used Qt Designer to make UI with my hands, and result is in file "mainWindow.ui";
  2. After that I used "pyuic5" and "pyrcc5" modules to turn this file to "mainWindow.py". Also there's file "ui.qrc", in containt some HEX-data that holds images that I used in Qt Designer. All is done using a script in "qtdesigner_to_py.bat": pyuic5 -x mainWindow.ui -o mainWindow.py pyrcc5 -o ui_rc.py ui.qrc exit So everytime I change something via Qt Designer I just run this script and UI is getting refreshed.
  3. And that's it! Now I just can use it from "main.py". I import from mainWindow import Ui_MainWindow and use it as parent for my UI class "MainWindow"
God-damnit-all commented 2 years ago

Ahhh, so it was Qt Designer, not Qt Creator. Looks a lot more user friendly. Thanks.