my.cpp
#include "my.h"
#include "ui_my.h"
my::my(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::my)
{
ui->setupUi(this);
this->setFixedSize(600,400);
this->setWindowIcon(QIcon(":/icon_z8w8m9orsdk/xx.png"));
this->setWindowTitle("XX");
this->setWindowOpacity(1);
this->setStyleSheet("background-color: white");
label = new QLabel(this);
label->setPixmap(QPixmap(":/icon/11.jpg"));
label->resize(600,150);
label->setScaledContents(true);
label1 = new QLabel(this);
label1->setPixmap(QPixmap(":/icon/logo1.webp"));
label1->resize(50,50);
label1->setScaledContents(true);
label1->move(5,5);
label2 = new QLabel(this);
label2->setPixmap(QPixmap(":/icon_z8w8m9orsdk/denglu.png"));
label2->resize(20,20);
label2->setScaledContents(true);
label2->move(150,210);
label3 = new QLabel(this);
label3->setPixmap(QPixmap(":/icon_z8w8m9orsdk/denglumima.png"));
label3->resize(20,20);
label3->setScaledContents(true);
label3->move(150,260);
label4 = new QLabel("找回密码",this);
label4->resize(100,20);
label4->move(450,300);
label4->setStyleSheet("boder:none;");
edit = new QLineEdit(this);
edit->move(180,210);
edit->setEchoMode(QLineEdit::Normal);
edit->resize(300,20);
edit->setPlaceholderText("QQ号码/手机/邮箱");
edit->setStyleSheet("border:none;border-bottom: 1px solid black;");
edit1 = new QLineEdit(this);
edit1->move(180,260);
edit1->setEchoMode(QLineEdit::PasswordEchoOnEdit);
edit1->resize(edit->size());
edit1->setPlaceholderText("密码");
edit1->setStyleSheet("border:none;border-bottom: 1px solid black;");
box = new QCheckBox(this);
box->move(150,300);
box->resize(100,20);
box->setText("自动登录");
box1 = new QCheckBox(this);
box1->move(300,300);
box1->resize(100,20);
box1->setText("记住密码");
button = new QPushButton("登录",this);
button->move(150,330);
button->resize(350,30);
button->setStyleSheet("border-radius: 5px;background-color:skyblue;");
connect(this->button,&QPushButton::clicked,this,&my::slots_jump);
};
my::~my()
{
delete ui;
}
void my::slots_jump()
{
emit my_signal();
this->close();
}
logn.cpp
#ifndef LOGN_H
#define LOGN_H
#include <QWidget>
namespace Ui {
class logn;
}
class logn : public QWidget
{
Q_OBJECT
public:
explicit logn(QWidget *parent = nullptr);
~logn();
private:
Ui::logn *ui;
public slots:
void slots_logn();
};
#endif // LOGN_H
main.cpp
#include "my.h"
#include "logn.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
my w;
w.show();
logn i;
QObject::connect(&w,&my::my_signal,&i,&logn::slots_logn);
return a.exec();
}