当前位置: 首页 > news >正文

QT_day1

#include "mywidget.h"MyWidget::MyWidget(QWidget *parent): QWidget(parent)
{//修改窗口标题this->setWindowTitle("4.6.0");//修改窗口图标this->setWindowIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\icon"));//修改窗口大小this->resize(1920,1100);//固定窗口大小this->setFixedSize(1920,1100);//设置窗口背景颜色this->setStyleSheet("background-color:rgb(255,255,255)");//设置纯净窗口this->setWindowFlag(Qt::FramelessWindowHint);//创建标签QLabel *back=new QLabel(this);back->setPixmap(QPixmap("C:\\Users\\zj\\Desktop\\yuanshen\\background"));back->resize(1920,1100);back->setScaledContents(true);//创建开始游戏按钮QPushButton *startbtn=new QPushButton;//设置依赖的父组件startbtn->setParent(this);//设置文本内容startbtn->setText("开始游戏");//设置背景颜色startbtn->setStyleSheet("background-color:rgb(255,200,9);border:none");//重设置按钮大小startbtn->resize(300,100);//移动按钮startbtn->move(1380,930);//设置按钮字体和大小startbtn->setFont(QFont("幼圆",20));//本地文件按钮QPushButton *localbtn=new QPushButton(this);localbtn->resize(55,100);localbtn->move(1680,930);localbtn->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\menu"));localbtn->setStyleSheet("background-color:rgb(255,200,9);border:none");//创建标签,标题背景QLabel *titlelab=new QLabel(this);titlelab->resize(1920,60);titlelab->setStyleSheet("background-color:rgb(20,20,20)");//创建标签,标题名1QLabel *titlenamelab=new QLabel("原神",this);titlenamelab->resize(70,60);titlenamelab->move(20,0);//设置字体颜色titlenamelab->setStyleSheet("color:rgb(226,226,226);background-color:rgb(20,20,20)");//创建标签,标题名2QLabel *titlename2lab=new QLabel("4.6.0",this);titlename2lab->resize(70,60);titlename2lab->move(70,0);//设置字体颜色titlename2lab->setStyleSheet("color:rgb(65,65,65);background-color:rgb(20,20,20)");//设置字体及大小titlename2lab->setFont(QFont("Times New Roman",12));//创建设置按钮QPushButton *setbtn=new QPushButton(this);//设置按钮大小setbtn->resize(60,60);//移动按钮setbtn->move(1740,0);//设置图片setbtn->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\set"));setbtn->setStyleSheet("border:none;background-color:rgb(20,20,20)");//创建最小化按钮QPushButton *minbtn=new QPushButton(this);//设置按钮大小minbtn->resize(60,60);//移动按钮minbtn->move(1800,0);//设置图片minbtn->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\min"));minbtn->setStyleSheet("border:none;background-color:rgb(20,20,20)");connect(minbtn,&QPushButton::clicked,this,&MyWidget::min1);//创建关闭按钮QPushButton *closebtn=new QPushButton(this);//设置按钮大小closebtn->resize(60,60);//移动按钮closebtn->move(1860,0);//设置图片closebtn->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\close"));closebtn->setStyleSheet("border:none;background-color:rgb(20,20,20)");connect(closebtn,&QPushButton::clicked,this,&MyWidget::close1);//创建滚动标签QLabel *rolllab=new QLabel(this);rolllab->resize(690,320);rolllab->move(75,350);rolllab->setPixmap(QPixmap("C:\\Users\\zj\\Desktop\\yuanshen\\info1"));rolllab->setScaledContents(Qt::FramelessWindowHint);//创建活动底色标签QLabel *back2lab=new QLabel(this);back2lab->resize(690,60);back2lab->move(75,695);back2lab->setStyleSheet("background-color:rgba(27,33,39,100)");//创建活动按钮QPushButton *actbtn=new QPushButton("活动",this);actbtn->resize(110,60);actbtn->move(80,695);actbtn->setStyleSheet("border:none;background:transparent;color:rgb(255,255,255)");actbtn->setFont(QFont("幼圆",14));//创建公告按钮QPushButton *annbtn=new QPushButton("公告",this);annbtn->resize(110,60);annbtn->move(180,695);annbtn->setStyleSheet("border:none;background:transparent;color:rgb(255,255,255)");annbtn->setFont(QFont("幼圆",14));//创建资讯按钮QPushButton *infobtn=new QPushButton("资讯",this);infobtn->resize(110,60);infobtn->move(280,695);infobtn->setStyleSheet("border:none;background:transparent;color:rgb(255,255,255)");infobtn->setFont(QFont("幼圆",14));//创建版本活动按钮QPushButton *info2btn=new QPushButton("版本热点",this);info2btn->resize(210,60);info2btn->move(1520,810);info2btn->setStyleSheet("background-color:rgb(232,230,237);color:rgb(115,47,46);border-radius:30");info2btn->setFont(QFont("幼圆",14));//创建内容标签QLabel *infolab=new QLabel(this);infolab->resize(690,125);infolab->move(75,755);infolab->setStyleSheet("background-color:rgba(7,14,19,100)");//创建背景标签QLabel *back3lab=new QLabel(this);back3lab->resize(115,1040);back3lab->move(1805,60);//设置背景标签颜色及透明度back3lab->setStyleSheet("background-color:rgba(27,33,39,100)");//侧边按钮QPushButton *rbtn1=new QPushButton(this);rbtn1->resize(60,60);rbtn1->move(1830,125);rbtn1->setStyleSheet("border-radius:30;background-color:rbga(0,0,0,0)");rbtn1->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\chat"));//侧边按钮微信QPushButton *rbtn2=new QPushButton(this);rbtn2->resize(60,60);rbtn2->move(1830,230);rbtn2->setStyleSheet("border-radius:30;background-color:rbga(0,0,0,100)");rbtn2->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\wechat"));//侧边按钮微博QPushButton *rbtn3=new QPushButton(this);rbtn3->resize(60,60);rbtn3->move(1830,335);rbtn3->setStyleSheet("border-radius:30;background-color:rbga(0,0,0,100)");rbtn3->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\sina"));//侧边按钮QPushButton *rbtn4=new QPushButton(this);rbtn4->resize(60,60);rbtn4->move(1830,440);rbtn4->setStyleSheet("border-radius:30;background-color:rbga(0,0,0,100)");rbtn4->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\local"));//侧边按钮qqQPushButton *rbtn5=new QPushButton(this);rbtn5->resize(60,60);rbtn5->move(1830,545);rbtn5->setStyleSheet("border-radius:30;background-color:rbga(0,0,0,100)");rbtn5->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\qq"));//侧边按钮QPushButton *rbtn6=new QPushButton(this);rbtn6->resize(60,60);rbtn6->move(1830,650);rbtn6->setStyleSheet("border-radius:30;background-color:rbga(0,0,0,100)");rbtn6->setIcon(QIcon("C:\\Users\\zj\\Desktop\\yuanshen\\faq"));}MyWidget::~MyWidget()
{
}
void MyWidget::close1(){this->close();
}
void MyWidget::min1(){this->showMinimized();
}

 

http://www.lryc.cn/news/342174.html

相关文章:

  • AWS宣布推出Amazon Q :针对商业数据和软件开发的生成性AI助手
  • C++:多继承虚继承
  • Linux进程间通信
  • 【二叉树算法题记录】222. 完全二叉树的节点个数
  • 每日新闻掌握【2024年5月6日 星期一】
  • 谈谈Tcpserver开启多线程并发处理遇到的问题!
  • 618好物节不知道买什么?快收下这份好物推荐指南!
  • Django高级表单处理与验证实战
  • 类和对象-Python-第一部分
  • Pytorch实现图片异常检测
  • 【NOI-题解】1586. 扫地机器人1430 - 迷宫出口1434. 数池塘(四方向)1435. 数池塘(八方向)
  • 探究MySQL行格式:解析DYNAMIC与COMPACT的异同
  • MATLAB绘制蒸汽压力和温度曲线
  • repo跟git的关系
  • Mysql 8.0 -- 最新版本安装(保姆级教程)
  • sql优化思路
  • gin学习1-7
  • likeshop多商户单商户商城_likeshop跑腿源码_likeshop物品租赁系统开源版怎么配置小程序对接?
  • (done) LSTM 详解 (包括它为什么能缓解梯度消失)
  • springboot使用研究
  • 老旧房屋用电线路故障引起的电气火灾预防对策​
  • OpenAI发布GPT-4.0使用指南
  • 【WEEK11】学习目标及总结【Spring Boot】【中文版】
  • Unity 性能优化之图片优化(八)
  • C++类细节,面试题02
  • Stylus的引入
  • 前端框架-echarts
  • 【StarRocks系列】 Trino 方言支持
  • 【2024最新华为OD-C卷试题汇总】URL拼接 (100分) - 三语言AC题解(Python/Java/Cpp)
  • 【ARM 嵌入式 C 字符串系列 23.7 -- C 实现函数 isdigit 和 isxdigit】