4/7 QT_day1

cpp 复制代码
#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    //窗口设置
    this->setWindowTitle("小黑子(little black son)");
    this->setWindowIcon(QIcon("D:\\qq文件\\Pitrue\\pictrue\\black.jpg"));
    this->setStyleSheet("background-color:white");
    this->resize(537,413);
    this->setFixedSize(535,415);
    //this->setWindowFlag(Qt::FramelessWindowHint);


    //设置按钮
    QPushButton *btn1 = new QPushButton("自动登录",this);
    btn1->move(121,307);
    btn1->resize(83,18);

    QPushButton *btn2 = new QPushButton("记住密码",this);
    btn2->move(239,307);
    btn2->resize(83,18);

    QPushButton *btn3 = new QPushButton("找回密码",this);
    btn3->move(358,307);
    btn3->resize(60,18);

    QPushButton *btn4 = new QPushButton("登录",this);
    btn4->move(121,342);
    btn4->resize(298,45);
    btn4->setStyleSheet("background-color:rgb(7,188,252);color:white;border-radius:10px");

    QPushButton *btn5 = new QPushButton("注册账号",this);
    btn5->move(16,384);
    btn5->resize(61,16);

    //设置行编译器
    QLineEdit *edit1 = new QLineEdit(this);
    edit1->setPlaceholderText("ikun账号");
    edit1->move(145,218);
    edit1->resize(247,20);


    QLineEdit *edit2 = new QLineEdit(this);
    edit2->setPlaceholderText("ikun码");
    edit2->move(145,247);
    edit2->resize(247,20);


    //设置标签
    QLabel *lab1 = new QLabel(this);
    lab1->resize(537,158);

    QMovie *mv = new QMovie("D:\\qq文件\\Pitrue\\pictrue\\cxk.gif");
    mv->setParent(this);
    lab1->setMovie(mv);
    mv->start();
    lab1->setScaledContents(true);

    QLabel *lab2 = new QLabel("标签",this);
    lab2->move(15,16);
    lab2->resize(28,34);
    lab2->setPixmap(QPixmap("D:\\qq文件\\Pitrue\\pictrue\\black.jpg"));
    lab2->setScaledContents(true);

    QLabel *lab3 = new QLabel("LBS",this);
    lab3->move(50,22);
    lab3->resize(25,21);
    lab3->setStyleSheet("color:black");

    QLabel *lab4 = new QLabel("标签",this);
    lab4->move(123,218);
    lab4->resize(16,20);
    lab4->setPixmap(QPixmap("D:\\qq文件\\Pitrue\\pictrue\\zh.jpg"));
    lab4->setScaledContents(true);

    QLabel *lab5 = new QLabel("标签",this);
    lab5->move(123,247);
    lab5->resize(16,20);
    lab5->setPixmap(QPixmap("D:\\qq文件\\Pitrue\\pictrue\\mm.jpg"));
    lab5->setScaledContents(true);
}

MainWindow::~MainWindow()
{
}
相关推荐
我是苏苏19 分钟前
消息中间件RabbitMQ02:账号的注册、点对点推送信息
开发语言·后端·ruby
工藤新一¹37 分钟前
C++/SDL 进阶游戏开发 —— 双人塔防(代号:村庄保卫战 14)
开发语言·c++·游戏引擎·游戏开发·sdl·实践项目
钢铁男儿1 小时前
C#核心技术解析:静态类型、dynamic与可空类型
开发语言·c#
卓越进步2 小时前
层级时间轮的 Golang 实现原理与实践
开发语言·后端·golang
zandy10112 小时前
嵌入式BI开发指南:如何通过衡石API将分析能力集成到业务系统?
开发语言·python·嵌入式
沉迷...2 小时前
el-input限制输入只能是数字 限制input只能输入数字
开发语言·前端·elementui
<但凡.2 小时前
C++修炼:list模拟实现
开发语言·数据结构·c++
zhangzhangkeji2 小时前
QT6 源(45):分隔条 QSplitter 允许程序的用户修改布局,程序员使用 IDE时,就是分隔条的用户,以及其 QSplitter 源代码
qt
byte轻骑兵2 小时前
【C++类和数据抽象】复制构造函数
开发语言·c++
孞㐑¥2 小时前
C++之异常
开发语言·c++·经验分享·笔记