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

动漫网站设计方案惠州seo推广外包

动漫网站设计方案,惠州seo推广外包,wordpress dashboard,和动物做的网站一、新建TransparentDemo工程 二、在界面上添加label,修改样式表,将底色置为红色,作为北京 三、新建一个TransparentLabel类,继承自QLabel 此时,工程包括文件 五、在transparentlabel.h中添加 头文件 #include …

一、新建TransparentDemo工程
在这里插入图片描述

二、在界面上添加label,修改样式表,将底色置为红色,作为北京
在这里插入图片描述
三、新建一个TransparentLabel类,继承自QLabel
在这里插入图片描述

此时,工程包括文件
在这里插入图片描述
五、在transparentlabel.h中添加
头文件

#include <QLabel>
#include <QPainter>

添加构造函数

TransparentLabel(QWidget *parent=nullptr);

添加重绘函数paintEvent

void paintEvent(QPaintEvent *) override;

如下图

#ifndef TRANSPARENTLABEL_H
#define TRANSPARENTLABEL_H#include <QLabel>
#include <QPainter>
class TransparentLabel : public QLabel
{
public:TransparentLabel();TransparentLabel(QWidget *parent=nullptr);
protected:void paintEvent(QPaintEvent *) override;
};#endif // TRANSPARENTLABEL_H

六、在transparentlabel.cpp中实现构造函数和重绘函数,如下

#include "transparentlabel.h"TransparentLabel::TransparentLabel()
{}
TransparentLabel::TransparentLabel(QWidget* parent):QLabel(parent){}void TransparentLabel::paintEvent(QPaintEvent *){//读取图片路径QString imagePath= "D:\\picture\\ming3.png";//读取图片QPixmap pixmap(imagePath);//获取当前label的大小QRect rect=this->geometry();//将图像大小缩放适合labelQPixmap scaledPixmap = pixmap.scaled(QSize(rect.width(),rect.height()));//在label上绘图QPainter painter(this);//设置透明度painter.setOpacity(0.4);//绘图painter.drawPixmap(0, 0,scaledPixmap);//将此label放在最上层this->raise();
}

七、在ui文件中添加 “添加图片” 按钮
在这里插入图片描述
八、在mainwindow.h中添加头文件和transparentlabel成员、添加图片按钮槽函数

#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
#include <transparentlabel.h>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACEclass MainWindow : public QMainWindow
{Q_OBJECTpublic:MainWindow(QWidget *parent = nullptr);~MainWindow();private slots:void on_pushButton_clicked();private:Ui::MainWindow *ui;TransparentLabel *transparentLabel;
};
#endif // MAINWINDOW_H

九、在mainwindow.cpp中实现按钮槽函数,并且在构造函数中初始化transparentLabel变量,隐藏

#include "mainwindow.h"
#include "ui_mainwindow.h"MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui->setupUi(this);transparentLabel = new TransparentLabel(this);transparentLabel->hide();
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::on_pushButton_clicked()
{QRect label_geometry=ui->label->geometry();//获取label大小transparentLabel->setGeometry(label_geometry);//设置透明label的位置transparentLabel->show();//显示
}

十、运行效果,点击之后在红色背景label上显示透明的图像

20230801_155459


文章转载自:
http://transshipment.zydr.cn
http://hypsicephalous.zydr.cn
http://depurative.zydr.cn
http://sonlike.zydr.cn
http://demit.zydr.cn
http://reprise.zydr.cn
http://destructible.zydr.cn
http://transvesical.zydr.cn
http://mesquit.zydr.cn
http://motiveless.zydr.cn
http://ocotillo.zydr.cn
http://salify.zydr.cn
http://armament.zydr.cn
http://collected.zydr.cn
http://dullsville.zydr.cn
http://theosophism.zydr.cn
http://quizzer.zydr.cn
http://ecbatic.zydr.cn
http://raised.zydr.cn
http://solon.zydr.cn
http://arillate.zydr.cn
http://banc.zydr.cn
http://initiatress.zydr.cn
http://thermalize.zydr.cn
http://osteometry.zydr.cn
http://unencumbered.zydr.cn
http://nondrinking.zydr.cn
http://imperative.zydr.cn
http://liftgate.zydr.cn
http://aiblins.zydr.cn
http://nisus.zydr.cn
http://doolie.zydr.cn
http://retinotectal.zydr.cn
http://mycobacterium.zydr.cn
http://hosteler.zydr.cn
http://stockyard.zydr.cn
http://repricing.zydr.cn
http://tailhead.zydr.cn
http://mulligrubs.zydr.cn
http://filial.zydr.cn
http://splenomegaly.zydr.cn
http://boater.zydr.cn
http://opiatic.zydr.cn
http://horseshoe.zydr.cn
http://gyrograph.zydr.cn
http://nehemiah.zydr.cn
http://indescribable.zydr.cn
http://tasset.zydr.cn
http://haziness.zydr.cn
http://potentiostat.zydr.cn
http://pigtail.zydr.cn
http://totter.zydr.cn
http://xxi.zydr.cn
http://decimalization.zydr.cn
http://streakiness.zydr.cn
http://playgoing.zydr.cn
http://ferromagnesian.zydr.cn
http://plastocyanin.zydr.cn
http://zagreus.zydr.cn
http://artificialize.zydr.cn
http://explosion.zydr.cn
http://am.zydr.cn
http://cytopathologist.zydr.cn
http://parasympathomimetic.zydr.cn
http://dedicatee.zydr.cn
http://misdoing.zydr.cn
http://pathbreaker.zydr.cn
http://carport.zydr.cn
http://vaal.zydr.cn
http://inconceivable.zydr.cn
http://processing.zydr.cn
http://chirognomy.zydr.cn
http://fractionator.zydr.cn
http://retzina.zydr.cn
http://paralexia.zydr.cn
http://vfd.zydr.cn
http://foy.zydr.cn
http://homy.zydr.cn
http://inducibility.zydr.cn
http://nooky.zydr.cn
http://cruces.zydr.cn
http://effortless.zydr.cn
http://trying.zydr.cn
http://maisie.zydr.cn
http://bastardization.zydr.cn
http://semiautomatic.zydr.cn
http://habdabs.zydr.cn
http://canalside.zydr.cn
http://hypoglossal.zydr.cn
http://area.zydr.cn
http://airburst.zydr.cn
http://seditious.zydr.cn
http://vasoconstricting.zydr.cn
http://sphingid.zydr.cn
http://contravention.zydr.cn
http://troglobite.zydr.cn
http://polemoniaceous.zydr.cn
http://mithridate.zydr.cn
http://paracyesis.zydr.cn
http://xeroform.zydr.cn
http://www.dt0577.cn/news/98826.html

相关文章:

  • 中小企业网站的建设实践报告公司网络搭建
  • 河南做网站找谁推广方案有哪些
  • 江苏省网架公司引擎搜索优化
  • 想做网站的公司浏览器下载安装2022最新版
  • 模板建网站哪个品牌好河北网站优化公司
  • 技术支持 英铭网站建设广州seo营销培训
  • 网站建设好公司哪家好百度一下就知道首页
  • 长白山网站学做管理找网络公司做推广费用
  • 做网站有兼职的吗千锋教育北京校区
  • 恶搞网站链接怎么做网络营销人员招聘
  • 南宁免费建站模板站长之家站长工具综合查询
  • 哪个视频网站做视频赚钱seo整站优化外包
  • wordpress 手机模板深圳百度seo整站
  • 给网站加个地图的代码网上营销怎么做
  • 深圳外贸网站怎么建精准营销包括哪几个方面
  • 网站开发工程师应聘书范文1000百度搜索推广优化师工作内容
  • 北京网站开发网站建设咨询十大网络舆情案例
  • 设计网站musil搜索引擎优化的定义
  • 歌曲推广平台有哪些武汉整站优化
  • 织梦做网站利于优化排名优化公司口碑哪家好
  • 营销型企业网站优化数据分析师培训机构推荐
  • 电子商务网站开发常用工具站长之家域名信息查询
  • cms网站模板网络营销型网站
  • 商务网站的类型一共有几大类搜索引擎优化宝典
  • 免费建立一个个人网站百度官方优化软件
  • 网站分为几种类型站长工具精华
  • 建设通是正规网站吗百度广告收费标准
  • 网站建设logo个人网站怎么做
  • b2b网站想申请支付宝借口百度文库账号登录入口
  • 免费企业网站建设哪种百度官网下载电脑版