forked from pyechat/pyechat
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (22 loc) · 781 Bytes
/
main.py
File metadata and controls
28 lines (22 loc) · 781 Bytes
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
import os
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt
from src.gui.main_window import MainWindow
def main():
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
app = QApplication(sys.argv)
app.setApplicationName("PyeChat")
if hasattr(app, 'setStyle') and sys.platform.startswith('linux'):
try: app.setStyle('gtk2')
except: pass
icon_path = os.path.join(os.path.dirname(__file__), 'assets', 'pyechat.png')
if os.path.exists(icon_path):
app.setWindowIcon(QIcon(icon_path))
window = MainWindow()
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()