Criando e compilando um arquivo UI com o Qt Designer
This commit is contained in:
91
aula203-qtdesigner/src/window.py
Normal file
91
aula203-qtdesigner/src/window.py
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
## Form generated from reading UI file 'window.ui'
|
||||||
|
##
|
||||||
|
## Created by: Qt User Interface Compiler version 6.4.2
|
||||||
|
##
|
||||||
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||||
|
QMetaObject, QObject, QPoint, QRect,
|
||||||
|
QSize, QTime, QUrl, Qt)
|
||||||
|
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||||
|
QFont, QFontDatabase, QGradient, QIcon,
|
||||||
|
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||||
|
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||||
|
from PySide6.QtWidgets import (QApplication, QGridLayout, QHBoxLayout, QLabel,
|
||||||
|
QLineEdit, QMainWindow, QMenuBar, QPushButton,
|
||||||
|
QSizePolicy, QStatusBar, QWidget)
|
||||||
|
|
||||||
|
class Ui_MainWindow(object):
|
||||||
|
def setupUi(self, MainWindow):
|
||||||
|
if not MainWindow.objectName():
|
||||||
|
MainWindow.setObjectName(u"MainWindow")
|
||||||
|
MainWindow.resize(800, 600)
|
||||||
|
self.centralwidget = QWidget(MainWindow)
|
||||||
|
self.centralwidget.setObjectName(u"centralwidget")
|
||||||
|
self.horizontalLayout = QHBoxLayout(self.centralwidget)
|
||||||
|
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||||
|
self.gridLayout = QGridLayout()
|
||||||
|
self.gridLayout.setObjectName(u"gridLayout")
|
||||||
|
self.labelResult = QLabel(self.centralwidget)
|
||||||
|
self.labelResult.setObjectName(u"labelResult")
|
||||||
|
font = QFont()
|
||||||
|
font.setPointSize(40)
|
||||||
|
self.labelResult.setFont(font)
|
||||||
|
self.labelResult.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
|
self.gridLayout.addWidget(self.labelResult, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.gridLayout_2 = QGridLayout()
|
||||||
|
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
||||||
|
self.labelName = QLabel(self.centralwidget)
|
||||||
|
self.labelName.setObjectName(u"labelName")
|
||||||
|
font1 = QFont()
|
||||||
|
font1.setPointSize(30)
|
||||||
|
self.labelName.setFont(font1)
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.labelName, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.lineName = QLineEdit(self.centralwidget)
|
||||||
|
self.lineName.setObjectName(u"lineName")
|
||||||
|
self.lineName.setFont(font1)
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.lineName, 0, 1, 1, 1)
|
||||||
|
|
||||||
|
self.buttonSend = QPushButton(self.centralwidget)
|
||||||
|
self.buttonSend.setObjectName(u"buttonSend")
|
||||||
|
self.buttonSend.setFont(font1)
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.buttonSend, 0, 2, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout.addLayout(self.gridLayout_2, 1, 0, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
self.horizontalLayout.addLayout(self.gridLayout)
|
||||||
|
|
||||||
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
|
self.menubar = QMenuBar(MainWindow)
|
||||||
|
self.menubar.setObjectName(u"menubar")
|
||||||
|
self.menubar.setGeometry(QRect(0, 0, 800, 22))
|
||||||
|
MainWindow.setMenuBar(self.menubar)
|
||||||
|
self.statusbar = QStatusBar(MainWindow)
|
||||||
|
self.statusbar.setObjectName(u"statusbar")
|
||||||
|
MainWindow.setStatusBar(self.statusbar)
|
||||||
|
|
||||||
|
self.retranslateUi(MainWindow)
|
||||||
|
|
||||||
|
QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
# setupUi
|
||||||
|
|
||||||
|
def retranslateUi(self, MainWindow):
|
||||||
|
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
|
||||||
|
self.labelResult.setText(QCoreApplication.translate("MainWindow", u"Voltei!", None))
|
||||||
|
self.labelName.setText(QCoreApplication.translate("MainWindow", u"Seu nome:", None))
|
||||||
|
self.lineName.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Digite seu nome", None))
|
||||||
|
self.buttonSend.setText(QCoreApplication.translate("MainWindow", u"Enviar", None))
|
||||||
|
# retranslateUi
|
||||||
|
|
||||||
91
aula203-qtdesigner/ui/ui_window.py
Normal file
91
aula203-qtdesigner/ui/ui_window.py
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
## Form generated from reading UI file 'window.ui'
|
||||||
|
##
|
||||||
|
## Created by: Qt User Interface Compiler version 6.4.2
|
||||||
|
##
|
||||||
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||||
|
QMetaObject, QObject, QPoint, QRect,
|
||||||
|
QSize, QTime, QUrl, Qt)
|
||||||
|
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||||
|
QFont, QFontDatabase, QGradient, QIcon,
|
||||||
|
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||||
|
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||||
|
from PySide6.QtWidgets import (QApplication, QGridLayout, QHBoxLayout, QLabel,
|
||||||
|
QLineEdit, QMainWindow, QMenuBar, QPushButton,
|
||||||
|
QSizePolicy, QStatusBar, QWidget)
|
||||||
|
|
||||||
|
class Ui_MainWindow(object):
|
||||||
|
def setupUi(self, MainWindow):
|
||||||
|
if not MainWindow.objectName():
|
||||||
|
MainWindow.setObjectName(u"MainWindow")
|
||||||
|
MainWindow.resize(800, 600)
|
||||||
|
self.centralwidget = QWidget(MainWindow)
|
||||||
|
self.centralwidget.setObjectName(u"centralwidget")
|
||||||
|
self.horizontalLayout = QHBoxLayout(self.centralwidget)
|
||||||
|
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||||
|
self.gridLayout = QGridLayout()
|
||||||
|
self.gridLayout.setObjectName(u"gridLayout")
|
||||||
|
self.labelResult = QLabel(self.centralwidget)
|
||||||
|
self.labelResult.setObjectName(u"labelResult")
|
||||||
|
font = QFont()
|
||||||
|
font.setPointSize(40)
|
||||||
|
self.labelResult.setFont(font)
|
||||||
|
self.labelResult.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
|
self.gridLayout.addWidget(self.labelResult, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.gridLayout_2 = QGridLayout()
|
||||||
|
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
||||||
|
self.labelName = QLabel(self.centralwidget)
|
||||||
|
self.labelName.setObjectName(u"labelName")
|
||||||
|
font1 = QFont()
|
||||||
|
font1.setPointSize(30)
|
||||||
|
self.labelName.setFont(font1)
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.labelName, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.lineName = QLineEdit(self.centralwidget)
|
||||||
|
self.lineName.setObjectName(u"lineName")
|
||||||
|
self.lineName.setFont(font1)
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.lineName, 0, 1, 1, 1)
|
||||||
|
|
||||||
|
self.buttonSend = QPushButton(self.centralwidget)
|
||||||
|
self.buttonSend.setObjectName(u"buttonSend")
|
||||||
|
self.buttonSend.setFont(font1)
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.buttonSend, 0, 2, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout.addLayout(self.gridLayout_2, 1, 0, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
self.horizontalLayout.addLayout(self.gridLayout)
|
||||||
|
|
||||||
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
|
self.menubar = QMenuBar(MainWindow)
|
||||||
|
self.menubar.setObjectName(u"menubar")
|
||||||
|
self.menubar.setGeometry(QRect(0, 0, 800, 22))
|
||||||
|
MainWindow.setMenuBar(self.menubar)
|
||||||
|
self.statusbar = QStatusBar(MainWindow)
|
||||||
|
self.statusbar.setObjectName(u"statusbar")
|
||||||
|
MainWindow.setStatusBar(self.statusbar)
|
||||||
|
|
||||||
|
self.retranslateUi(MainWindow)
|
||||||
|
|
||||||
|
QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
# setupUi
|
||||||
|
|
||||||
|
def retranslateUi(self, MainWindow):
|
||||||
|
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
|
||||||
|
self.labelResult.setText(QCoreApplication.translate("MainWindow", u"Voltei!", None))
|
||||||
|
self.labelName.setText(QCoreApplication.translate("MainWindow", u"Seu nome:", None))
|
||||||
|
self.lineName.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Digite seu nome", None))
|
||||||
|
self.buttonSend.setText(QCoreApplication.translate("MainWindow", u"Enviar", None))
|
||||||
|
# retranslateUi
|
||||||
|
|
||||||
93
aula203-qtdesigner/ui/window.ui
Normal file
93
aula203-qtdesigner/ui/window.ui
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindow</class>
|
||||||
|
<widget class="QMainWindow" name="MainWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelResult">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>40</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Voltei!</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelName">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>30</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Seu nome:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineName">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>30</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Digite seu nome</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="buttonSend">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>30</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Enviar</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menubar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Reference in New Issue
Block a user