Skip to content
97 changes: 97 additions & 0 deletions login.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'login.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox
from signup import Ui_Signup

class Ui_Dialog(object):

# event handler for signup button
def signup_check(self):
print("signup button is clicked")

self.signupWindow = QtWidgets.QDialog()
self.ui = Ui_Signup()
self.ui.setupUi(self.signupWindow)
self.signupWindow.show()

def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(637, 477)
Dialog.setStyleSheet("QDialog{\n"
" background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255))\n"
"}\n"
"QPushButton{\n"
" background-color:rgb(255, 255, 255)\n"
" border: none;\n"
"}")
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setGeometry(QtCore.QRect(160, 170, 91, 21))
self.label_2.setObjectName("label_2")
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setGeometry(QtCore.QRect(160, 220, 91, 21))
self.label_3.setObjectName("label_3")
self.email_field = QtWidgets.QLineEdit(Dialog)
self.email_field.setGeometry(QtCore.QRect(240, 170, 201, 22))
self.email_field.setText("")
self.email_field.setObjectName("email_field")
self.password_field = QtWidgets.QLineEdit(Dialog)
self.password_field.setGeometry(QtCore.QRect(240, 220, 201, 22))
self.password_field.setEchoMode(QtWidgets.QLineEdit.PasswordEchoOnEdit)
self.password_field.setObjectName("password_field")
self.login_button = QtWidgets.QPushButton(Dialog)
self.login_button.setGeometry(QtCore.QRect(290, 280, 93, 28))
self.login_button.setObjectName("login_button")
self.signup_button = QtWidgets.QPushButton(Dialog)
self.signup_button.setGeometry(QtCore.QRect(290, 320, 93, 28))
self.signup_button.setObjectName("signup_button")
#########################3 Signup button event ########################
self.signup_button.clicked.connect(self.signup_check)
#######################################################################
self.login_page_label = QtWidgets.QLabel(Dialog)
self.login_page_label.setGeometry(QtCore.QRect(220, 70, 211, 91))
self.login_page_label.setMinimumSize(QtCore.QSize(5, 0))
self.login_page_label.setBaseSize(QtCore.QSize(40, 16))
font = QtGui.QFont()
font.setPointSize(41)
font.setBold(False)
font.setItalic(False)
font.setUnderline(False)
font.setWeight(50)
font.setStrikeOut(False)
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
self.login_page_label.setFont(font)
self.login_page_label.setFocusPolicy(QtCore.Qt.NoFocus)
self.login_page_label.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.login_page_label.setTextFormat(QtCore.Qt.AutoText)
self.login_page_label.setAlignment(QtCore.Qt.AlignCenter)
self.login_page_label.setObjectName("login_page_label")

self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label_2.setText(_translate("Dialog", "Email:"))
self.label_3.setText(_translate("Dialog", "Password: "))
self.login_button.setText(_translate("Dialog", "Login"))
self.signup_button.setText(_translate("Dialog", "Sign Up"))
self.login_page_label.setText(_translate("Dialog", "Login Page"))



if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
154 changes: 154 additions & 0 deletions login.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>637</width>
<height>477</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="styleSheet">
<string notr="true">QDialog{
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255))
}
QPushButton{
background-color:rgb(255, 255, 255)
border: none;
}</string>
</property>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>160</x>
<y>170</y>
<width>91</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Email:</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>160</x>
<y>220</y>
<width>91</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Password: </string>
</property>
</widget>
<widget class="QLineEdit" name="email_field">
<property name="geometry">
<rect>
<x>240</x>
<y>170</y>
<width>201</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLineEdit" name="password_field">
<property name="geometry">
<rect>
<x>240</x>
<y>220</y>
<width>201</width>
<height>22</height>
</rect>
</property>
<property name="echoMode">
<enum>QLineEdit::PasswordEchoOnEdit</enum>
</property>
</widget>
<widget class="QPushButton" name="login_button">
<property name="geometry">
<rect>
<x>290</x>
<y>280</y>
<width>93</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>Login</string>
</property>
</widget>
<widget class="QPushButton" name="signup_button">
<property name="geometry">
<rect>
<x>290</x>
<y>320</y>
<width>93</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>Sign Up</string>
</property>
</widget>
<widget class="QLabel" name="login_page_label">
<property name="geometry">
<rect>
<x>220</x>
<y>70</y>
<width>211</width>
<height>91</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>5</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>40</width>
<height>16</height>
</size>
</property>
<property name="font">
<font>
<pointsize>41</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="text">
<string>Login Page</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
77 changes: 77 additions & 0 deletions signup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'signup.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Signup(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(629, 446)
Dialog.setStyleSheet("QDialog{\n"
" background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255))\n"
"}\n"
"QPushButton{\n"
" background-color:rgb(255, 255, 255)\n"
" border: none;\n"
"}")
self.email_field = QtWidgets.QLineEdit(Dialog)
self.email_field.setGeometry(QtCore.QRect(240, 150, 201, 22))
self.email_field.setText("")
self.email_field.setObjectName("email_field")
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setGeometry(QtCore.QRect(160, 200, 91, 21))
self.label_3.setObjectName("label_3")
self.signup_button = QtWidgets.QPushButton(Dialog)
self.signup_button.setGeometry(QtCore.QRect(290, 260, 93, 28))
self.signup_button.setObjectName("signup_button")
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setGeometry(QtCore.QRect(160, 150, 91, 21))
self.label_2.setObjectName("label_2")
self.password_field = QtWidgets.QLineEdit(Dialog)
self.password_field.setGeometry(QtCore.QRect(240, 200, 201, 22))
self.password_field.setEchoMode(QtWidgets.QLineEdit.PasswordEchoOnEdit)
self.password_field.setObjectName("password_field")
self.login_page_label = QtWidgets.QLabel(Dialog)
self.login_page_label.setGeometry(QtCore.QRect(190, 30, 251, 91))
self.login_page_label.setMinimumSize(QtCore.QSize(5, 0))
self.login_page_label.setBaseSize(QtCore.QSize(40, 16))
font = QtGui.QFont()
font.setPointSize(41)
font.setBold(False)
font.setItalic(False)
font.setUnderline(False)
font.setWeight(50)
font.setStrikeOut(False)
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
self.login_page_label.setFont(font)
self.login_page_label.setFocusPolicy(QtCore.Qt.NoFocus)
self.login_page_label.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.login_page_label.setTextFormat(QtCore.Qt.AutoText)
self.login_page_label.setAlignment(QtCore.Qt.AlignCenter)
self.login_page_label.setObjectName("login_page_label")

self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label_3.setText(_translate("Dialog", "Password: "))
self.signup_button.setText(_translate("Dialog", "Sign Up"))
self.label_2.setText(_translate("Dialog", "Email:"))
self.login_page_label.setText(_translate("Dialog", "Sign Up Page"))


if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Signup()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
Loading