Qt day1

制作仿完美世界竞技平台登录界面

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

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    //设置窗口标题
    this->setWindowTitle("完美世界竞技平台");
    //设置窗口图标
    this->setWindowIcon(QIcon("E:\\perfectword_window\\WA.png"));
    //设置窗口大小
    this->resize(440,650);
    //固定窗口大小,防止缩放
    this->setFixedSize(440,650);
    //设置窗口背景颜色
    this->setStyleSheet("background-color:rgb(20,22,25)");
    //完美发光文字
    QLabel *lab1 = new QLabel("标签",this);
    lab1->move(55,20);
    lab1->resize(330,90);
    lab1->setPixmap(QPixmap("E:\\perfectword_window\\perfectworld.png"));
    lab1->setScaledContents(true);
    //CS图框
    QLabel *lab2 = new QLabel(this);
    lab2->move(72,130);
    lab2->resize(290,55);
    lab2->setPixmap(QPixmap("E:\\perfectword_window\\CS.png"));
    lab2->setScaledContents(true);
    //登录黑色背景框
    QLabel *lab3 = new QLabel;
    lab3->setParent(this);
    lab3->move(73,226);
    lab3->resize(277,271);
    lab3->setStyleSheet("background-color:rgb(10,12,15)");

    //头像标签
    QLabel *lab4 = new QLabel(this);
    lab4->move(148,306);
    lab4->resize(128,128);
    lab4->setPixmap(QPixmap("E:\\perfectword_window\\tou.png"));
    lab4->setScaledContents(true);

    //登录按钮
    QPushButton *btn = new QPushButton(this);
    btn->setText("点击登录");
    btn->move(158,444);
    btn->resize(100,39);
    btn->setStyleSheet("background-color:rgb(111,166,255)");

    //其他登录方式
    QPushButton *btn1 = new QPushButton(this);
    btn1->setText("其他登录方式   >");
    btn1->setStyleSheet("background-color:rgb(111,166,255)");
    btn1->move(73,518);
    btn1->resize(280,50);

}

Widget::~Widget()
{
}
相关推荐
Felix_One1 天前
Qt 串口通信避坑指南:QSerialPort 的 5 个常见问题
qt
blasit4 天前
笔记:Qt C++建立子线程做一个socket TCP常连接通信
c++·qt·tcp/ip
郑州光合科技余经理9 天前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php
feifeigo1239 天前
matlab画图工具
开发语言·matlab
dustcell.9 天前
haproxy七层代理
java·开发语言·前端
norlan_jame9 天前
C-PHY与D-PHY差异
c语言·开发语言
多恩Stone9 天前
【C++入门扫盲1】C++ 与 Python:类型、编译器/解释器与 CPU 的关系
开发语言·c++·人工智能·python·算法·3d·aigc
QQ4022054969 天前
Python+django+vue3预制菜半成品配菜平台
开发语言·python·django
遥遥江上月9 天前
Node.js + Stagehand + Python 部署
开发语言·python·node.js
m0_531237179 天前
C语言-数组练习进阶
c语言·开发语言·算法