widget.cpp
#include "widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
this->setFixedSize(320,448);
this->setWindowFlag(Qt::FramelessWindowHint);
//QPushButton
QPushButton *PushButton1 = new QPushButton("登录",this);
PushButton1->move(30,320);
PushButton1->setFixedSize(261,41);
QPushButton *PushButton2 = new QPushButton("扫码登录",this);
PushButton2->move(90,400);
PushButton2->setFixedSize(61,20);
QPushButton *PushButton3 = new QPushButton("更多选项",this);
PushButton3->move(170,400);
PushButton3->setFixedSize(61,21);
QPushButton *PushButton4 = new QPushButton("/",this);
PushButton4->move(260,0);
PushButton4->setFixedSize(31,31);
QPushButton *PushButton5 = new QPushButton("x",this);
PushButton5->move(290,0);
PushButton5->setFixedSize(31,31);
//LineEdit
QLineEdit *LineEdit1 = new QLineEdit(this);
LineEdit1->setPlaceholderText("输入QQ号");
LineEdit1->move(30,170);
LineEdit1->setFixedSize(261,41);
QLineEdit *LineEdit2 = new QLineEdit(this);
LineEdit2->setPlaceholderText("输入QQ密码");
LineEdit2->move(30,220);
LineEdit2->setFixedSize(261,41);
//QLabel
QLabel *QLable1 = new QLabel(this);
//QLable1->setText("LOGO");
QLable1->move(120,60);
QLable1->setFixedSize(81,81);
QLable1->setStyleSheet("background-color:skyblue");
//QComboBox
QComboBox *QComboBox1 = new QComboBox(this);
QComboBox1->move(250,170);
QComboBox1->setFixedSize(41,41);
//QRadioButton
QRadioButton *RadioButton1 = new QRadioButton(this);
RadioButton1->setText("已阅读并同意服务协议和QQ隐私保护指引");
RadioButton1->move(40,280);
RadioButton1->setFixedSize(241,18);
}
Widget::~Widget()
{
}
widget.h
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QComboBox>
#include <QGraphicsView>
#include <QRadioButton>
#include <QMouseEvent>
class Widget : public QWidget
{
Q_OBJECT
public:
Widget(QWidget *parent = nullptr);
~Widget();
};
#endif // WIDGET_H
效果图
思维导图
做一半手贱删了还没保存,先欠着