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

攻击网站常用方法seo优化关键词排名

攻击网站常用方法,seo优化关键词排名,怎么做网站关键词,湖北seo服务重新实现paintEvent()函数。 效果如下&#xff1a; 效果为蓝色区域&#xff0c;背景是vs接面&#xff0c;代码直接复制可用&#xff0c;留给有需要的人。 #ifndef CircleWidget_h__ #define CircleWidget_h__#include <QWidget>class CCircleWidget : public QWidget {Q…

重新实现paintEvent()函数。

效果如下:

 效果为蓝色区域,背景是vs接面,代码直接复制可用,留给有需要的人。

#ifndef CircleWidget_h__
#define CircleWidget_h__#include <QWidget>class CCircleWidget : public QWidget
{Q_OBJECTpublic:explicit CCircleWidget(QWidget* parent = 0); // explicit 避免歧义CCircleWidget(const QString& strImagePath, int nRadius, QWidget* parent = 0);public:void SetNormalOutLineColor(QColor color);void SetHoverOutLineColor(QColor color);void SetPressedOutLineColor(QColor color);void SetOutLineWidth(int nWidth);void SetImagePath(const QString& strImagePath);void SetHovered(bool bHovered);void SetPressed(bool bPressed);protected: // overridevoid Init();void paintEvent(QPaintEvent*) override;                // 绘图事件,调用update()时触发void mousePressEvent(QMouseEvent* e) override;          // 鼠标按下事件void mouseReleaseEvent(QMouseEvent* e) override;        // 鼠标释放事件void enterEvent(QEvent*) override;                     // 鼠标进入事件void leaveEvent(QEvent*) override;                     // 鼠标离开事件signals:void SigClicked(); // 点击信号private:QString m_strImagePath; // 图片路径QColor m_normalColor;QColor m_hoverColor;QColor m_pressedColor;int m_nWidth;int m_nRadius;        // 圆形半径bool m_bPressed;      // 左键单击控制bool m_bHovered;      // 鼠标悬停控制
};#endif // CircleWidget_h__
#include "CircleWidget.h"
#include <QPainter>
#include <QMouseEvent>CCircleWidget::CCircleWidget(QWidget* parent): QWidget(parent), m_strImagePath(":/dotnetIcon.png"), m_normalColor("#58a3ef"), m_hoverColor("#6eb8f5"), m_pressedColor("#417cac"), m_nWidth(4), m_nRadius(46), m_bPressed(false), m_bHovered(false)
{Init();
}CCircleWidget::CCircleWidget(const QString& strImagePath, int nRadius, QWidget* parent): QWidget(parent), m_strImagePath(strImagePath), m_normalColor("#58a3ef"), m_hoverColor("#6eb8f5"), m_pressedColor("#417cac"), m_nWidth(4), m_nRadius(nRadius), m_bPressed(false), m_bHovered(false)
{Init();
}void CCircleWidget::SetNormalOutLineColor(QColor color)
{m_normalColor = color;
}void CCircleWidget::SetHoverOutLineColor(QColor color)
{m_hoverColor = color;
}void CCircleWidget::SetPressedOutLineColor(QColor color)
{m_pressedColor = color;
}void CCircleWidget::SetOutLineWidth(int nWidth)
{m_nWidth = nWidth;
}void CCircleWidget::SetImagePath(const QString& strImagePath)
{m_strImagePath = strImagePath;
}void CCircleWidget::SetHovered(bool bHovered)
{m_bHovered = bHovered;update();
}void CCircleWidget::SetPressed(bool bPressed)
{m_bPressed = bPressed;update();
}void CCircleWidget::Init()
{// 无边框setWindowFlags(Qt::FramelessWindowHint);// 窗口背景透明setAttribute(Qt::WA_TranslucentBackground, true);
}void CCircleWidget::paintEvent(QPaintEvent*)
{QPainter p(this);p.setRenderHint(QPainter::Antialiasing);QPen pen;pen.setWidth(m_nWidth);if (m_bPressed){pen.setColor("#417cac"); // 按下时的边框颜色}else if (m_bHovered){pen.setColor("#6eb8f5"); // 悬停时的边框颜色}else{pen.setColor("#58a3ef"); // 正常状态的边框颜色}p.setPen(pen);p.setBrush(Qt::NoBrush);// 设置圆心为圆的半径,以确保圆形完整显示//QPoint center(m_nRadius + m_nWidth / 2, m_nRadius + m_nWidth / 2);QPoint center(rect().center());// 绘制背景圆形p.drawEllipse(center, m_nRadius, m_nRadius);// 绘制图片QPixmap pixmap(m_strImagePath);QRect imageRect(0, 0, 2 * m_nRadius, 2 * m_nRadius); // 计算图片绘制区域QPainterPath clipPath;clipPath.addEllipse(center, m_nRadius, m_nRadius);p.setClipPath(clipPath);p.drawPixmap(center.x() - m_nRadius, center.y() - m_nRadius, imageRect.width(), imageRect.height(), pixmap);
}void CCircleWidget::mousePressEvent(QMouseEvent* e)
{m_bPressed = true;update();
}void CCircleWidget::mouseReleaseEvent(QMouseEvent* e)
{m_bPressed = false;update();
}void CCircleWidget::enterEvent(QEvent*)
{m_bHovered = true;update();
}void CCircleWidget::leaveEvent(QEvent*)
{m_bHovered = false;update();
}
http://www.yayakq.cn/news/788774/

相关文章:

  • 九亭镇村镇建设办官方网站wordpress的幻灯片
  • 网站建设 7 24网站建设的编程
  • 手机网站怎么切图3d网页游戏
  • 营销型网站建设 代理郑州企业建网站制作
  • 自己做购物网站好吗2023年建筑项目招标信息
  • 郑州网络公司排名seo优化评论
  • 手机商城网站免费建站一个公司设计网站怎么做
  • 成品网站源码1二维码页面设计模板
  • 公司网站优化去哪里学做像58同城样的网站
  • 个人网站建立 学生网站设计板块
  • 简单的方法搭建网站海报设计理念
  • 广西茶叶网站建设wordpress 中文主题
  • 宿州企业网站推广最新新闻热点事件2022年
  • 开发一个卖东西的网站多少网站链接推广怎么赚钱
  • 动感十足的网站chrome官网下载
  • 网站建设心得体会及总结怎么上网站后台
  • 12306网站开始是谁开发的个人网页设计作品 布局
  • 网站的软文 怎么做推广方案国际重大新闻事件2023
  • 布吉附近做网站微信公众号怎样创建
  • cdn网站网站界面用什么做
  • python+视频播放网站开发网站建设H5 源码
  • 站长工具seo综合查询下载安装怎么做祝福的网站
  • 温州哪里可以做企业网站钟表商城网站建设方案
  • 一个人做网站时间广州近期流行的传染病
  • 知识付费网站源码途途外贸企业网站管理系统
  • 免费网站软件哪个好广州seo培训机构
  • 做爰网站视屏微信小程序脚本
  • 做移动网站点击软件下载企业系统培训平台
  • 网站开发费入什么科目适合手机的网站
  • 地税网站建设管理做标志的好网站