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

Qt windows 全屏弹幕工具

Qt 5 开发,windows 全屏弹幕工具,内置自己实现的输入法,截屏工具,自定义菜单等。

 部分代码

#include "xyemoticonwidget.h"
#include "xyexpressionlabel.h"
#include <QGridLayout>
#include <QVBoxLayout>
#include <QMovie>
#include <QScrollArea>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QFileDialog>XYEmoticonWidget::XYEmoticonWidget(QWidget *parent): QDialog(parent)
{ QGridLayout *layout = new QGridLayout;for (int i = 0; i < 88; ++i){XYExpressionLabel *label = new XYExpressionLabel;connect(label, SIGNAL(clicked(QString)), this, SIGNAL(clicked(QString)));QMovie *move = new QMovie;move->setFileName(QString(":/Gif/%1").arg(i));move->start();label->setMovie(move);layout->addWidget(label, i % 10, i / 10, Qt::AlignCenter);}for (int i = 0; i < 66; ++i){XYExpressionLabel *label = new XYExpressionLabel;connect(label, SIGNAL(clicked(QString)), this, SIGNAL(clicked(QString)));QMovie *move = new QMovie;move->setFileName(QString(":/Gif1/%1").arg(i));move->start();label->setMovie(move);layout->addWidget(label, (i + 88) % 10, (i + 88) / 10, Qt::AlignCenter);}for (int i = 0; i < 104; ++i){XYExpressionLabel *label = new XYExpressionLabel;connect(label, SIGNAL(clicked(QString)), this, SIGNAL(clicked(QString)));QMovie *move = new QMovie;move->setFileName(QString(":/Gif2/%1").arg(i));move->start();label->setMovie(move);layout->addWidget(label, (i + 154) % 10, (i +154) / 10, Qt::AlignCenter);}QWidget *emo = new QWidget;emo->setLayout(layout);QScrollArea *area = new QScrollArea;area->setWidget(emo);QDialogButtonBox *box = new QDialogButtonBox;QPushButton *open = new QPushButton("Open other");connect(open, SIGNAL(clicked()), this, SLOT(openImage()));QPushButton *ok = new QPushButton("Close");connect(ok, SIGNAL(clicked()), this, SLOT(close()));box->addButton(open, QDialogButtonBox::ResetRole);box->addButton(ok, QDialogButtonBox::YesRole);QVBoxLayout *layout_main = new QVBoxLayout;layout_main->addWidget(area);layout_main->addWidget(box, Qt::AlignRight);setLayout(layout_main);resize(900, 600);
}void XYEmoticonWidget::openImage()
{QString imageFile = QFileDialog::getOpenFileName(this, tr("Open File"),QString(),tr("Images (*.png *.xpm *.jpg *.ico);;All (*.*)"));emit clicked(imageFile);
}

http://www.dtcms.com/a/304003.html

相关文章:

  • 【Golang】Go语言指针
  • 鱼皮项目简易版 RPC 框架开发(六)----最后的绝唱
  • Qt|槽函数耗时操作阻塞主界面问题
  • go标准库log模块学习笔记
  • spring cloud sentinel 动态规则配置
  • css3之三维变换详说
  • Windows系统ffmpeg.dll丢失怎么办?从错误分析到永久修复的完整流程
  • FPGA实现SRIO高速接口与DSP交互,FPGA+DSP异构方案,提供3套工程源码和技术支持
  • 处理订单过期但支付成功的系统设计:平衡用户体验与业务规则
  • 设计模式:中介者模式 Mediator
  • Oracle发布MCP Server,自然语言交互说“人话”
  • Kubernetes高级调度01
  • 设计模式十三:代理模式(Proxy Pattern)
  • pygame 模拟放飞气球
  • hive专题面试总结
  • Python 日期时间格式化与解析的瑞士军刀:`strftime()` 与 `strptime()`
  • 三、Linux用户与权限管理详解
  • Baumer工业相机堡盟工业相机如何通过YoloV8深度学习模型实现各种食物的类型检测识别(C#代码UI界面版)
  • 学习嵌入式的第三十四天-数据结构-(2025.7.29)数据库
  • 小杰数据结构(one day)——心若安,便是晴天;心若乱,便是阴天。
  • 【数据可视化-75】北京密云区2025年7月暴雨深度分析:Python + Pyecharts 炫酷大屏可视化(含完整数据、代码)
  • Prometheus + Grafana + Micrometer 监控方案详解
  • Java:为什么需要通配符捕获(wildcard capture)
  • HbuilderX开发小程序
  • 定制开发开源AI智能名片S2B2C商城小程序对流量重构与价值提升的作用研究
  • 使用git托管keil工程
  • React函数组件的“生活管家“——useEffect Hook详解
  • C++:stack与queue的使用
  • 40+个常用的Linux指令——下
  • 基于变频与移相混合控制(PFM+PSM)的全桥LLC谐振变换器仿真模型