寒假作业

 手写盗版微信登入界面

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->resize(421,575);
    this->setFixedSize(421,575);
    this->setWindowFlag(Qt::FramelessWindowHint);
    //创建登入按钮
    QPushButton *btn1 = new QPushButton;
    btn1->setParent(this);
    btn1->setText("进入微信");
    btn1->move(74,404);
    btn1->resize(267,55);
    btn1->setFont(QFont("Arial",12));
  //btn1->setStyleSheet("color:white");
    btn1->setStyleSheet("background-color:green");
    //创建头像标签
    QLabel *lab1 = new QLabel;
    lab1->setParent(this);
    lab1->resize(120,120);
    lab1->move(155,127);
    lab1->setStyleSheet("background-color:white");
    //给头像标签加入图片
    lab1->setPixmap(QPixmap("D:\\newQT\\QT_code\\untitled2\\pictrue\\zaoyo.jpg"));
    lab1->setScaledContents(true);
    //创建idb标签
    QLabel *labid = new QLabel;
    labid->setParent(this);
    labid->setText("指尖流烟");
    labid->resize(120,40);
    labid->move(155,282);
    labid->setFont(QFont("Arial",15));
    //创建按钮x
    QPushButton * btnx =new QPushButton(this);
    btnx->resize(50,50);
    btnx->move(371,0);
    btnx->setStyleSheet("background-color:red");
    btnx->setText(" X");
    btnx->setFont(QFont("Arial",15));
    //点击btnx关闭当前界面
    //连接槽函数
    connect(btnx,SIGNAL(clicked()),this,SLOT(my_slot_close()));
    //创建3个标签
    QLabel * labtxt1 = new QLabel(this);
    QLabel * labtxt2 = new QLabel(this);
    QLabel * labtxt3 = new QLabel(this);
    labtxt1->setText("切换账号");
    labtxt2->setText("文件传输");
    labtxt3->setText("盗版微信");
    labtxt1->setFont(QFont("Arial",12));
    labtxt2->setFont(QFont("Arial",12));
    labtxt3->setFont(QFont("Arial",12));
    labtxt1->move(100,500);
    labtxt2->move(235,500);


}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::my_slot_close()
{
    this->close();
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值