-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
28 lines (20 loc) · 667 Bytes
/
test.py
File metadata and controls
28 lines (20 loc) · 667 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
from PyQt6.QtWidgets import QApplication, QMainWindow
from PyQt6.QtGui import QIcon
import sys
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
# Set window title
self.setWindowTitle("Custom Icon Example")
# Set the custom taskbar icon
self.setWindowIcon(QIcon("icon.ico")) # Ensure this path is correct
# Set window size
self.setGeometry(100, 100, 400, 300)
if __name__ == "__main__":
app = QApplication(sys.argv)
# Create the main window
window = MainWindow()
# Show the main window
window.show()
# Run the application
sys.exit(app.exec())