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

网站买空间品牌营销成功案例

网站买空间,品牌营销成功案例,广州新增疫情最新消息今天,如何选择做网站文章目录 一、前言二、使用1.FormLoading.h2.FormLoading.cpp 一、前言 项目中在下发指令时,结果异步返回,可能需要一段时间,因此需要用到加载动画。 用的比较简单,就是新建Widget子窗口,放一个Label,使用…

文章目录

  • 一、前言
  • 二、使用
    • 1.FormLoading.h
    • 2.FormLoading.cpp


一、前言

项目中在下发指令时,结果异步返回,可能需要一段时间,因此需要用到加载动画。
用的比较简单,就是新建Widget子窗口,放一个Label,使用QMovie在Label中播放GIF。
当下发指令时,就打开子窗口显示加载过程,同时开启一个定时器,如果在定时器触发超时信号或超时之前收到结果,则隐藏加载过程子窗口,并关闭定时器。

二、使用

1.FormLoading.h

#ifndef FORMLOADING_H
#define FORMLOADING_H#include <QWidget>
#include <QMovie>
#include <QLabel>namespace Ui {
class FormLoading;
}class FormLoading : public QWidget
{Q_OBJECTpublic:explicit FormLoading(QWidget *parent = 0);~FormLoading();void startAnimation();void stopAnimation();protected:void paintEvent(QPaintEvent *p1);private:Ui::FormLoading *ui;QMovie *m_pMovie;QLabel *m_pLabel;
};#endif // FORMLOADING_H

2.FormLoading.cpp

#include "formloading.h"
#include "ui_formloading.h"
#include <QVBoxLayout>
#include <QPainter>
#include <QBitmap>
FormLoading::FormLoading(QWidget *parent) :QWidget(parent),ui(new Ui::FormLoading)
{ui->setupUi(this);// 设置窗口置顶和无边框this->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);// 设置窗口透明用来支持圆角样式属性this->setAttribute(Qt::WA_TranslucentBackground);// 设置模态对话框this->setWindowModality(Qt::ApplicationModal);setFixedSize(350, 280);m_pMovie = new QMovie(":/images/loading.gif");m_pLabel = new QLabel(this);m_pLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);// 设置背景透明m_pLabel->setAutoFillBackground(true);//m_pLabel->setStyleSheet("width:150px;border-radius:10px; background-color: rgb(255, 255, 255);");m_pLabel->setStyleSheet("background-color: rgba(255, 255, 255, 0);");m_pLabel->setMovie(m_pMovie);QVBoxLayout *pLayout = new QVBoxLayout(this);pLayout->addWidget(m_pLabel);setLayout(pLayout);
}FormLoading::~FormLoading()
{delete ui;if(m_pMovie != nullptr){delete m_pMovie;}if(m_pLabel != nullptr){delete m_pLabel;}
}// 绘图事件
void FormLoading::paintEvent(QPaintEvent *p1)
{//绘制样式QStyleOption opt;opt.init(this);QPainter p(this);style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);//绘制样式QBitmap bmp(this->size());bmp.fill();QPainter painter(&bmp);painter.setPen(Qt::NoPen);painter.setBrush(Qt::black);painter.setRenderHint(QPainter::Antialiasing);painter.drawRoundedRect(bmp.rect(), 15, 15);setMask(bmp);
}void FormLoading::startAnimation()
{m_pMovie->start();
}void FormLoading::stopAnimation()
{m_pMovie->stop();
}
http://www.ds6.com.cn/news/9287.html

相关文章:

  • 嘉定网站建设公司网络推销平台有哪些
  • 做网站需要学什么语言谷歌排名规则
  • 综合返利商城网站建设西安百度推广客服电话多少
  • vue做前台网站百度排名优化咨询电话
  • 做企业网站百度推广客服怎么打电话搜狗搜索引擎网页
  • 百度推广代理加盟首页关键词排名优化
  • 做外贸自己建网站想做网络推广如何去做
  • app在线苏州网站优化公司
  • 电子元器件商城官网长沙seo代理
  • wordpress html音乐石家庄自动seo
  • psd网站首页图片交换友情链接的网站标准是什么
  • 如何为网站做推广设计网站官网
  • 泉州pc网站开发百度搜索引擎网站
  • 网站建设价值成都爱站网seo站长查询工具
  • 怎样做ppt建网站西安网站建设方案优化
  • 品牌创建的六个步骤快速排名优化
  • 商城网站模块百度网址大全旧版安装
  • 做外贸英语要什么网站个人博客seo
  • 临汾推广型网站建设个人在线网站推广
  • 网站seo设计企业文化的重要性和意义
  • 网站问题有哪些内容域名解析查询
  • 中国建设工程监理协会网站nba排名2021最新排名
  • 江西网站制作的公司哪家好百度怎么免费推广自己的产品
  • 广州网站设计智能 乐云践新专家关键词排名关键词优化
  • 做框架图的网站在百度怎么发广告做宣传
  • 湛江做网站手机推广平台有哪些
  • 网站功能方案推广计划怎么做推广是什么
  • 如何评估网站重庆森林经典台词梁朝伟
  • 廊坊建手机网站2022最火营销方案
  • 从什么网站找做app的代码网络培训机构