# cPy qt_intro : label
# Copyright by Anthony Vogelaar, Perth Scotland
# rev 0.10  2026-01-14  initial release

from    PySide6.QtWidgets   import  QApplication, QWidget, QLabel

# ========================== demo 1 ==============================

# most simple label on form
class Gui1(QWidget):

    def __init__(self):
        app = QApplication()            # Qt framework
        super().__init__()              # instantiate QWidget
        lbl = QLabel('Hello word', self)
        self.show()
        app.exec()


Gui1()

# ========================== demo 2 ==============================

# positioning of label
class Gui2(QWidget):

    def __init__(self):
        app = QApplication()            # Qt framework
        super().__init__()              # instantiate QWidget
        self.resize(500, 200)
        lbl = QLabel('Hello word', self)
        lbl.move(100, 50)
        self.show()
        app.exec()


#Gui2()

# ========================== demo 3 ==============================

# size, style and color of label
class Gui3(QWidget):

    def __init__(self):
        app = QApplication()            # Qt framework
        super().__init__()              # instantiate QWidget
        self.resize(500, 200)
        lbl = QLabel('Hello word', self)
        lbl.move(50, 50)
        #lbl.setStyleSheet('font-size: 32px')
        #lbl.setStyleSheet('font-size: 80px; font-style: italic')
        lbl.setStyleSheet('font-size: 80px; font-style: italic; color: red')
        self.show()
        app.exec()


#Gui3()

# ========================== demo 4 ==============================

# multiple labels
class Gui4(QWidget):

    def __init__(self):
        app = QApplication()            # Qt framework
        super().__init__()              # instantiate QWidget = Form
        self.resize(500, 200)
        lbl = QLabel('Blue', self)
        lbl.move(100, 50)
        lbl.setStyleSheet('font-size: 40px; color: red')
        lbl = QLabel('Red', self)
        lbl.move(300, 50)
        lbl.setStyleSheet('font-size: 40px; color: blue')
        self.show()
        app.exec()


#Gui4()

# ============================== end =============================
