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

from    PySide6.QtWidgets   import  QApplication, QWidget

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

# most simple Qt form
class Gui1(QWidget):

    def __init__(self):
        app = QApplication()            # Qt framework
        super().__init__()              # instantiate QWidget
        self.show()
        app.exec()


Gui1()

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

# positioning and size of form
class Gui2(QWidget):

    def __init__(self):
        app = QApplication()            # Qt framework
        super().__init__()              # instantiate QWidget
#        self.move(10, 10)
#        self.resize(100, 100)
        self.setGeometry(50, 50, 500, 200)
        self.show()
        app.exec()

#Gui2()

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

# add title and background color 
class Gui3(QWidget):

    def __init__(self):
        app = QApplication()            # Qt framework
        super().__init__()              # instantiate QWidget
        self.setWindowTitle('Qt intro Gui3')
        #self.setStyleSheet('background-color: yellow')
        #self.setStyleSheet('background-color: rgb(255,0 , 0)')
        self.setStyleSheet('background-color: #006400')
        self.show()
        app.exec()


#Gui3()

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

# add background color and preventing CSS inteferentie
# see https://htmlcolorcodes.com/color-names/
class Gui4(QWidget):

    def __init__(self):
        app = QApplication()            # Qt framework
        super().__init__()              # instantiate QWidget
        self.setStyleSheet('background-color: Yellow')
        #self.setStyleSheet('QWidget {background-color: Gold}')
        #self.setObjectName('form')
        #self.setStyleSheet('#form {background-color: LightYellow}')
        #self.setStyleSheet('QWidget#form {background-color: PeachPuff}')
        self.show()
        app.exec()


#Gui4()

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