-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
57 lines (42 loc) · 1.45 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
""" Main entry point to the ThermalMesh application. """
# define authorship information
__authors__ = ['Samuel Dubois']
__author__ = ','.join(__authors__)
__contact__ = '[email protected]'
__credits__ = []
__copyright__ = 'Copyright (c) Buildwise 2023'
__license__ = ''
from multiprocessing import freeze_support
def main(argv=None):
"""
Creates the main window for the application and begins the \
QApplication if necessary.
:param argv | [, ..] || None
:return error code
"""
# Define installation path
install_folder = os.path.dirname(__file__)
app = None
# create the application if necessary
if (not QtWidgets.QApplication.instance()):
app = QtWidgets.QApplication(argv)
app.setStyle('Breeze')
# create the main window
from gui.thermalmesh import ThermalWindow
window = ThermalWindow()
window.setWindowTitle('IR Mapper')
window.setWindowIcon(QtGui.QIcon(res.find('img/icone.png')))
window.showMaximized()
# run the application if necessary
if (app):
return app.exec_()
# no errors since we're not running our own event loop
return 0
if __name__ == '__main__':
freeze_support() # To avoid pipinstaller bug. Note: all libraries are imported after freeze_support
from PySide6 import QtWidgets, QtGui
# from PySide6 import QtWebEngineWidgets
import os
import sys
import resources as res
sys.exit(main(sys.argv))