QT--1
类型界面
#include "mywidget.h"
myWidget::myWidget(QWidget *parent)
: QWidget(parent)
{
//=======窗口相关设置======
this->resize(680,520);
this->setFixedSize(680,520);
this->setWindowTitle("Tim");
this->setWindowFlag(Qt::FramelessWindowHint);
this->setStyleSheet("background-color:rgb(255,255,255)");
//=======标签相关设置======
QLabel *lab1 = new QLabel(this);
lab1->resize(400,520);
lab1->setPixmap(QPixmap("C:\\Users\\l\\Desktop\\pictrue\\tim.png"));
//=======行编辑器相关设置=======
QLineEdit *edit1 = new QLineEdit(this);
edit1->resize(220,50);
edit1->move(430,270-50);
edit1->setPlaceholderText("QQ号码/手机号/邮箱");
QLineEdit *edit2 = new QLineEdit(this);
edit2->resize(220,50);
edit2->move(430,270);
edit2->setPlaceholderText("密码");
edit2->setEchoMode(QLineEdit::Password);
//=======按钮相关设置=====
QPushButton *btn1 = new QPushButton(this);
btn1->resize(64,64);
btn1->move(500-32,120-32);
btn1->setStyleSheet("background-color:rgb(17,145,255);border-radius:32px");
btn1->setIcon(QIcon("C:\\Users\\l\\Desktop\\pictrue\\qie.png"));
QPushButton *btn2 = new QPushButton(this);
btn2->resize(64,64);
btn2->move(580-32,120-32);
btn2->setStyleSheet("background-color:rgb(245,245,245);border-radius:32px");
btn2->setIcon(QIcon("C:\\Users\\l\\Desktop\\pictrue\\wechat.png"));
QPushButton *btn3 = new QPushButton("记住密码",this);
btn3->resize(74,25);
btn3->move(430,440);
btn3->setIcon(QIcon("C:\\Users\\l\\Desktop\\pictrue\\kuang.png"));
QPushButton *btn4 = new QPushButton("自动登陆",this);
btn4->resize(74,25);
btn4->move(430,470);
btn4->setIcon(QIcon("C:\\Users\\l\\Desktop\\pictrue\\kuang.png"));
QPushButton *btn5 = new QPushButton("找回密码",this);
btn5->resize(74,25);
btn5->move(600,440);
QPushButton *btn6 = new QPushButton("注册密码",this);
btn6->resize(74,25);
btn6->move(600,470);
QPushButton *btn7 = new QPushButton(this);
btn7->resize(25,25);
btn7->move(640,12);
btn7->setIcon(QIcon("C:\\Users\\l\\Desktop\\pictrue\\x.png"));
QPushButton *btn8 = new QPushButton(this);
btn8->resize(25,25);
btn8->move(605,12);
btn8->setIcon(QIcon("C:\\Users\\l\\Desktop\\pictrue\\set.png"));
}
myWidget::~myWidget()
{
}
原文地址:https://blog.csdn.net/Slipman/article/details/138506455
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!