# Introduction to Qt - demonstrating an image on QLabel
# by Anthony Vogelaar, Perth Scotland
# rev 0.10  2024-03-31  Initial release

import  os, sys, signal;     os.system('clear')
from    PySide6.QtWidgets   import  QApplication, QLabel
from    PySide6.QtGui       import  QPixmap, QResizeEvent

# ================================== GUI =========================================

class GUI(QLabel):

    def __init__(self):
        self.app = QApplication([])
        super().__init__()
        self.setWindowTitle('The Title')
        self.resize(1000, 450)
        self.img = QPixmap('img/forth_bridge.jpg')
        self.setPixmap(self.img)
        self.show()


    # overwrite resizeEvent
    # def resizeEvent(self, event: QResizeEvent) -> None:
    #     w = self.width(); h = self.height()
    #     self.setPixmap(self.img.scaled(w, h))
    

# ================================ Main ==========================================
        
signal.signal(signal.SIGINT, signal.SIG_DFL)        # handle ctrl-c
gui     = GUI()
sys.exit(gui.app.exec())

# ================================= End ==========================================
