您的位置:首页 > 新闻 > 热点要闻 > 广告设计专业毕业去哪就业_黄山旅游攻略冬季_广州营销课程培训班_百度竞价教程

广告设计专业毕业去哪就业_黄山旅游攻略冬季_广州营销课程培训班_百度竞价教程

2025/3/14 5:53:07 来源:https://blog.csdn.net/qq_65292344/article/details/144794906  浏览:    关键词:广告设计专业毕业去哪就业_黄山旅游攻略冬季_广州营销课程培训班_百度竞价教程
广告设计专业毕业去哪就业_黄山旅游攻略冬季_广州营销课程培训班_百度竞价教程

在登录界面的登录取消按钮进行以下设置:
使用手动连接,将登录框中的取消按钮使用qt4版本的连接到自定义的槽函数中,在自定义的槽函数中调用关
闭函数
将登录按钮使用qt5版本的连接到自定义的槽函数中,在槽函数中判断ui界面上输入的账号是否为"admin",密
码是否为"123456",如果账号密码匹配成功,则输出“登录成功”,并关闭该界面,弹出另一个界面。如果匹配
失败,则输出登录失败,并将密码

框中的内容清空

#ifndef SECOND_H
#define SECOND_H#include <QWidget>namespace Ui {
class Second;
}class Second : public QWidget
{Q_OBJECTpublic:explicit Second(QWidget *parent = nullptr);~Second();public slots:void jump_slot();private:Ui::Second *ui;
};#endif // SECOND_H
#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>
#include <QDebug>
#include <QMessageBox>QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACEclass Widget : public QWidget
{Q_OBJECTpublic:Widget(QWidget *parent = nullptr);~Widget();signals:void my_jump();private slots:void on_pushButton_clicked();private:Ui::Widget *ui;
};
#endif // WIDGET_H
#include "widget.h"
#include"second.h"#include <QApplication>int main(int argc, char *argv[])
{QApplication a(argc, argv);Widget w;w.show();Second s;QObject::connect(&w, &Widget::my_jump,&s,&Second::jump_slot);return a.exec();
}
#include "second.h"
#include "ui_second.h"Second::Second(QWidget *parent) :QWidget(parent),ui(new Ui::Second)
{ui->setupUi(this);
}Second::~Second()
{delete ui;
}void Second::jump_slot()
{this->show();
}
#include "widget.h"
#include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget)
{ui->setupUi(this);this->setWindowFlag(Qt::FramelessWindowHint);this->setAttribute(Qt::WA_TranslucentBackground);
}Widget::~Widget()
{delete ui;
}void Widget::on_pushButton_clicked()
{if(ui->lineEdit->text() == "admin" && ui->lineEdit_2->text() == "123456"){qDebug() << "登录成功!";this->close();emit my_jump();}else{qDebug() << "登录失败!";QMessageBox::critical(this, "错误", "用户名或密码错误!");ui->lineEdit_2->setText("");}
}
*{background-color: rgb(255, 255, 255);
}QFrame#frame{border-image: url(:/Logo/shanChuan.jpg);border-radius:30px;
}
#frame_2{border-radius:30px;background-color: rgba(173, 173, 173, 120);
}QLabel#label{background-color: rgb(88, 88, 88, 120);border-radius:30px;
}
#label_2{font: 18pt "等线";background:transparent;color: rgba(255, 255, 255, 150);
}QLineEdit{background:transparent;border:none;border-bottom:1px solid rgba(255, 255, 255, 150);color: rgba(255, 255, 255, 150);
}QPushButton{font: 10pt "等线";color: rgba(255, 255, 255, 150);background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(75, 109, 247, 255), stop:1 rgba(255, 255, 255, 255));border-radius:8px;
}QPushButton:hover{/*鼠标移动*/font: 10pt "等线";color: rgba(255, 255, 255, 150);background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(115, 109, 247, 255), stop:1 rgba(255, 255, 255, 255));border-radius:8px;
}QPushButton:pressed{/*鼠标按下*/font: 10pt "等线";color: rgba(255, 255, 255, 150);background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(75, 109, 247, 255), stop:1 rgba(255, 255, 255, 255));border-radius:8px;padding-top:5px;padding-left:5px;
}

 

 

 

 

 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com