Qt Resource Generator
This commit is contained in:
parent
fca7ccef71
commit
80f59e27e1
1 changed files with 20 additions and 0 deletions
20
src/QrcGenerate.py
Normal file
20
src/QrcGenerate.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/python
|
||||
|
||||
import os,subprocess
|
||||
|
||||
# Jump to src
|
||||
os.chdir("src")
|
||||
|
||||
# Create Qrc file
|
||||
listrc = os.listdir('UI')
|
||||
listrc.remove('res.qrc')
|
||||
f = open('UI/res.qrc', 'w')
|
||||
f.write("""<RCC><qresource prefix="/">""")
|
||||
for i in listrc:
|
||||
f.write(f"<file>{i}</file>")
|
||||
f.write("""</qresource></RCC>""")
|
||||
f.close()
|
||||
|
||||
# Compile Qrc & Create onefile script & run it
|
||||
subprocess.run("""rcc -g python UI/res.qrc -o Res.py && sed -i 's/PySide2/PyQt6/g' Res.py && echo "#!/usr/bin/python" > Welcome && cat Res.py >> Welcome && cat Welcome.py >> Welcome && chmod +x Welcome && sed -i 's/import Res//g' Welcome && mv Welcome ../build/parch-welcome/usr/bin""",shell=True)
|
Loading…
Add table
Reference in a new issue