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()
{
}
相关推荐
用户805533698034 小时前
不止三件套:QObject 属性系统全关键字与运行时反射!
c++·qt
xcyxiner4 小时前
DicomViewer (vcpkg Windows和ubuntu编译)7
qt
Quz5 天前
QML Hello World 入门示例
qt
xcyxiner8 天前
DicomViewer (dcmtk读取dcm文件)5
qt
xcyxiner9 天前
DicomViewer (后台线程处理文件)4
qt
xcyxiner9 天前
DicomViewer (添加模型类)3
qt
xcyxiner10 天前
DicomViewer (目录调整) 2
qt
xcyxiner10 天前
dcmtk vtk vtk-dicom(gdcm) 编译(debug) v2
qt
LDR00612 天前
Type-C 快充全面升级!LDR6601 赋能个人护理便携电机,重塑剃须刀 / 理发器新体验
c语言·开发语言
雪碧聊技术12 天前
Tree.js是什么?一文讲透
开发语言·javascript·ecmascript