QSS简单写的登录注册页面,方便后面直接复制使用
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Regina</class>
<widget class="QDialog" name="Regina">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>450</height>
</rect>
</property>
<property name="windowTitle">
<string>登录</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="page">
<property name="styleSheet">
<string notr="true">#page{
background-color: rgb(255, 255, 255);
}</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>601</width>
<height>181</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(162,102,254);</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>131</width>
<height>81</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
font: 24pt "华文行楷";</string>
</property>
<property name="text">
<string>登录</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>260</x>
<y>140</y>
<width>80</width>
<height>80</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(254,249,225);
border-radius: 40px;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnToRegister">
<property name="geometry">
<rect>
<x>10</x>
<y>410</y>
<width>71</width>
<height>28</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{
border: none;
color: rgb(166,166,166);
}
QPushButton:hover{
color: rgb(131,131,131);
}
</string>
</property>
<property name="text">
<string>注册账号</string>
</property>
</widget>
<widget class="QPushButton" name="btnLogin">
<property name="geometry">
<rect>
<x>150</x>
<y>370</y>
<width>300</width>
<height>45</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{
border-radius: 5px;
border: none;
background-color: rgb(30,199,253);
color: rgb(255, 255, 255);
font: 16pt "楷体";
}
QPushButton:hover{
background-color: rgb(122,226,255);
}</string>
</property>
<property name="text">
<string>登录</string>
</property>
</widget>
<widget class="QLineEdit" name="txtIdL">
<property name="geometry">
<rect>
<x>150</x>
<y>240</y>
<width>300</width>
<height>50</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit{
border: none;
background-color: rgba(255, 255, 255, 0);
border-bottom: 1px solid rgb(229,229,229);
font: 14pt "黑体";
color: rgb(193,193,193);
}
QLineEdit:focus{
border-bottom: 1px solid rgb(193,193,193);
color: rgb(33,33,33);
}</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLineEdit" name="txtPwdL">
<property name="geometry">
<rect>
<x>150</x>
<y>300</y>
<width>300</width>
<height>50</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit{
border: none;
background-color: rgba(255, 255, 255, 0);
border-bottom: 1px solid rgb(229,229,229);
font: 14pt "黑体";
color: rgb(193,193,193);
}
QLineEdit:focus{
border-bottom: 1px solid rgb(193,193,193);
color: rgb(33,33,33);
}</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="page_2">
<property name="styleSheet">
<string notr="true">#page_2{
background-color: rgb(255, 255, 255);
}</string>
</property>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>131</width>
<height>81</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
font: 24pt "华文行楷";</string>
</property>
<property name="text">
<string>注册</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="txtIdR">
<property name="geometry">
<rect>
<x>150</x>
<y>240</y>
<width>300</width>
<height>50</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit{
border: none;
background-color: rgba(255, 255, 255, 0);
border-bottom: 1px solid rgb(229,229,229);
font: 14pt "黑体";
color: rgb(77, 77, 77);
}
QLineEdit:focus{
border-bottom: 1px solid rgb(193,193,193);
color: rgb(33,33,33);
}</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>260</x>
<y>140</y>
<width>80</width>
<height>80</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(155,208,248);
border-radius: 40px;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLineEdit" name="txtPwdR">
<property name="geometry">
<rect>
<x>150</x>
<y>300</y>
<width>300</width>
<height>50</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit{
border: none;
background-color: rgba(255, 255, 255, 0);
border-bottom: 1px solid rgb(229,229,229);
font: 14pt "黑体";
color: rgb(193,193,193);
}
QLineEdit:focus{
border-bottom: 1px solid rgb(193,193,193);
color: rgb(33,33,33);
}</string>
</property>
</widget>
<widget class="QPushButton" name="btnRegister">
<property name="geometry">
<rect>
<x>150</x>
<y>370</y>
<width>300</width>
<height>45</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{
border-radius: 5px;
border: none;
background-color: rgb(30,199,253);
color: rgb(255, 255, 255);
font: 16pt "楷体";
}
QPushButton:hover{
background-color: rgb(122,226,255);
}</string>
</property>
<property name="text">
<string>注册</string>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>601</width>
<height>181</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(162,102,254);</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnToLogin">
<property name="geometry">
<rect>
<x>10</x>
<y>410</y>
<width>71</width>
<height>28</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{
border: none;
color: rgb(166,166,166);
}
QPushButton:hover{
color: rgb(131,131,131);
}
</string>
</property>
<property name="text">
<string>继续登录</string>
</property>
</widget>
<zorder>txtIdR</zorder>
<zorder>txtPwdR</zorder>
<zorder>btnRegister</zorder>
<zorder>label_6</zorder>
<zorder>label_4</zorder>
<zorder>label_5</zorder>
<zorder>btnToLogin</zorder>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>