Python PyQt5 LABELS are easy! 🏷️

preview_player
Показать описание
#pythontutorial #python #pyqt5

# PyQt5 QLabels
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
from PyQt5.QtGui import QFont
from PyQt5.QtCore import Qt

class MainWindow(QMainWindow):
def __init__(self):
super().__init__()

label = QLabel("Hello", self)
"background-color: #6fdcf7;"
"font-weight: bold;"
"font-style: italic;"
"text-decoration: underline;")

def main():
window = MainWindow()

if ___name___ == "__main__":
main()
Рекомендации по теме
Комментарии
Автор

# PyQt5 QLabels
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
from PyQt5.QtGui import QFont
from PyQt5.QtCore import Qt

class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setGeometry(700, 300, 500, 500)

label = QLabel("Hello", self)
label.setFont(QFont("Arial", 40))
label.setGeometry(0, 0, 500, 100)
label.setStyleSheet("color: #292929;"
"background-color: #6fdcf7;"
"font-weight: bold;"
"font-style: italic;"
"text-decoration: underline;")

# # VERTICALLY TOP
# # VERTICALLY BOTTOM
# # VERTICALLY CENTER

# # HORIZONTALLY RIGHT
# # HORIZONTALLY CENTER
# # HORIZONTALLY LEFT

# | Qt.AlignTop) # CENTER & TOP
# | Qt.AlignBottom) # CENTER & BOTTOM
# | Qt.AlignVCenter) # CENTER & CENTER
# # CENTER & CENTER

def main():
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())

if ___name___ == "__main__":
main()

BroCodez
Автор

Hi bro can you please make a Django or flask tutorial in the future! ❤❤

jereinnico
Автор

html devs crying because they can't center a div without google

Jsjjjs
Автор

Not to ask a lot, but can you make a course video to learn Godot and so its script?

ferneto-htfc
Автор

i want to buy a member ship or send money in comment

azrielleon