作业--day42
2024-01-08 20:38:16
界面设计
MyProWin::MyProWin(QWidget *parent)
: QMainWindow(parent)
{
/**********窗口主体**********/
//窗口大小
this->setFixedSize(644, 493);
this->setWindowTitle("QQ");
this->setWindowIcon(QIcon("C:/Users/10988/Downloads/pictrue/pictrue/qq.png"));
this->setStyleSheet("background-color:white");
this->setWindowFlag(Qt::FramelessWindowHint);
/*********标签内容**********/
//上部内容label
QLabel *upper_lab = new QLabel(this);
upper_lab->resize(644, 290);
upper_lab->setScaledContents(true);
QMovie *upper_mv = new QMovie("C:/Users/10988/Downloads/pictrue/pictrue/qq2.gif");
upper_lab->setMovie(upper_mv);
upper_mv->start();
//QQ的图标label
QLabel *qq_upper_lab = new QLabel(this);
qq_upper_lab->move(30, 20);
qq_upper_lab->setScaledContents(true);
qq_upper_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/QQicon.png"));
qq_upper_lab->resize(50,50);
qq_upper_lab->setStyleSheet("background-color:transparent");
//账号label
QLabel *account_lab = new QLabel(this);
account_lab->move(145,260);
account_lab->setScaledContents(true);
account_lab->resize(25,30);
account_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/QQaccount.png"));
//密码label
QLabel *pwd_lab = new QLabel(this);
pwd_lab->move(145,310);
pwd_lab->setScaledContents(true);
pwd_lab->resize(25,30);
pwd_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/qqpwd.png"));
//头像label
QLabel *img_lab = new QLabel(this);
img_lab->move(270,140);
img_lab->setScaledContents(true);
img_lab->resize(100,100);
//设置透明背景
img_lab->setStyleSheet("background-color:transparent");
img_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/boy_h.png"));
//找回密码label
QLabel *fpwd_lab = new QLabel(this);
fpwd_lab->move(440, 350);
fpwd_lab->setScaledContents(true);
fpwd_lab->setText("找回密码");
//注册账号label
QLabel *reg_lab = new QLabel(this);
reg_lab->move(30, 450);
reg_lab->setScaledContents(true);
reg_lab->setText("注册账号");
//二维码label
QLabel *qr_lab = new QLabel(this);
qr_lab->move(580,450);
qr_lab->setScaledContents(true);
qr_lab->resize(25,25);
qr_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/qr.png"));
/**********输入框**************/
//账号输入框
QLineEdit *account_le = new QLineEdit(this);
account_le->setPlaceholderText("QQ号码/手机/邮箱");
account_le->resize(345,30);
account_le->move(175, 260);
//密码输入框
QLineEdit *pwd_le = new QLineEdit(this);
pwd_le->setEchoMode(QLineEdit::Password);
pwd_le->resize(345,30);
pwd_le->move(175, 310);
/***********确认框************/
//自动登录框
QCheckBox *login_ck = new QCheckBox(this);
login_ck->move(145, 350);
login_ck->setText("自动登录");
//记住密码框
QCheckBox *pwd_ck = new QCheckBox(this);
pwd_ck->move(300, 350);
pwd_ck->setText("记住密码");
/*************按钮*************/
//登录按钮
QPushButton *login_bnt = new QPushButton(this);
login_bnt->move(145,400);
login_bnt->resize(370, 60);
login_bnt->setText("登录");
login_bnt->setStyleSheet("background-color:rgb(70,127,231)");
}
思维导图
文章来源:https://blog.csdn.net/qq_39831963/article/details/135465187
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!