mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-11 17:24:29 +02:00
Spacing fixes
This commit is contained in:
@@ -17,22 +17,22 @@ import sys
|
|||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
def window():
|
def window():
|
||||||
# Crear el objeto de la aplicación
|
# Crear el objeto de la aplicación
|
||||||
app = QtGui.QApplication(sys.argv)
|
app = QtGui.QApplication(sys.argv)
|
||||||
# Crear un widget en el que colocaremos nuestra etiqueta
|
# Crear un widget en el que colocaremos nuestra etiqueta
|
||||||
w = QtGui.QWidget()
|
w = QtGui.QWidget()
|
||||||
# Agregamos nuesta etiqueta al widget
|
# Agregamos nuesta etiqueta al widget
|
||||||
b = QtGui.QLabel(w)
|
b = QtGui.QLabel(w)
|
||||||
# Agregamos texto a nuestra etiqueta
|
# Agregamos texto a nuestra etiqueta
|
||||||
b.setText("Hello World!")
|
b.setText("Hello World!")
|
||||||
# Fijemos información de posición y tamaño del widget
|
# Fijemos información de posición y tamaño del widget
|
||||||
w.setGeometry(100, 100, 200, 50)
|
w.setGeometry(100, 100, 200, 50)
|
||||||
b.move(50, 20)
|
b.move(50, 20)
|
||||||
# Proporcionemos un título a nuestra ventana
|
# Proporcionemos un título a nuestra ventana
|
||||||
w.setWindowTitle("PyQt")
|
w.setWindowTitle("PyQt")
|
||||||
# Mostremos todo
|
# Mostremos todo
|
||||||
w.show()
|
w.show()
|
||||||
# Ejecutemos lo que hayamos solicitado ya inicializado el resto
|
# Ejecutemos lo que hayamos solicitado ya inicializado el resto
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Reference in New Issue
Block a user