An error occurred while loading the file. Please try again.
-
Pierre-Antoine Rouby authored524868dc
# -*- coding: utf-8 -*-
import os
from PyQt5 import QtGui
from PyQt5.QtWidgets import (
QMainWindow, QApplication,
)
from PyQt5.uic import loadUi
class ApplicationWindow(QMainWindow):
def __init__(self):
super(ApplicationWindow, self).__init__()
self.ui = loadUi(
os.path.join(os.path.dirname(__file__), "ui", "MainWindow.ui"),
self
)
self.set_icon()
self.showMaximized()
def set_icon(self):
"""
Add icon to application window
"""
icon = QtGui.QIcon()
_path= os.path.join(os.path.dirname(__file__), "ui", "resources", "M_icon.png")
icon.addPixmap(QtGui.QPixmap(f"{_path}"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.setWindowIcon(icon)