-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicApp.py
More file actions
30 lines (20 loc) · 1021 Bytes
/
BasicApp.py
File metadata and controls
30 lines (20 loc) · 1021 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
29
30
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QMainWindow, QLabel, QApplication
from PyQt6.QtCore import Qt, QSize
import ctypes
# This code makes it so windows doesn't think Pythonw.exe's icon should be used for this window's icon
myappid = u'mycompany.myproduct.subproduct.version' #arbitrary string
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
class MainWindow(QMainWindow): #Boilerplate
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.setWindowIcon(QIcon("icons\\Icon.png"))
self.setWindowTitle("Basic Application")
self.setMinimumSize(QSize(450, 300))
label = QLabel("Lable with some text in it, cool!")
label.setAlignment(Qt.AlignmentFlag.AlignHCenter)
self.setCentralWidget(label)
app = QApplication([])
window = MainWindow()
window.show() #Windows are made invisible by default, need show func to show them
app.exec()