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

aaa云主机可以建网站吗谷歌云宝塔搭建WordPress

aaa云主机可以建网站吗,谷歌云宝塔搭建WordPress,网页设计实训总结3000字大学篇,网页qq登陆网站本文实现的目的是#xff1a;视图缩放时#xff0c;缩略图中的矩形框也进行缩放#xff0c;而缩略图中的矩形区域为视图中的可见区。 获取视图中滚动条的值#xff0c;将其值与缩略图所在的小窗口对比#xff0c;可通过绘图求其比例#xff0c;再按比例缩小。 首先提供主…本文实现的目的是视图缩放时缩略图中的矩形框也进行缩放而缩略图中的矩形区域为视图中的可见区。 获取视图中滚动条的值将其值与缩略图所在的小窗口对比可通过绘图求其比例再按比例缩小。 首先提供主要的代码 connect(view-verticalScrollBar(),QScrollBar::valueChanged,this,chunzhongForm::slot_VvalueChanged); connect(view-horizontalScrollBar(),QScrollBar::valueChanged,this,chunzhongForm::slot_HvalueChanged);void chunzhongForm::slot_VvalueChanged(int value) {if(value ! 0 dlg ! NULL){m_y value;if(dlg-isVisible()){emit signalSetDrawRectSize();}} }void chunzhongForm::slot_HvalueChanged(int value) {if(value ! 0 dlg ! NULL){m_x value;if(dlg-isVisible()){emit signalSetDrawRectSize();}} }connect(this,chunzhongForm::signalSetDrawRectSize,this,chunzhongForm::slot_setViewRect);QSize GraphicsView::viewportSizeHint() {return viewport()-size(); }void chunzhongForm::slot_setViewRect() {m_viewSize view-viewportSizeHint();//获取视口大小int x m_x / (m_viewSize.width() * m_scale)* SMALL_W;int y m_y / (m_viewSize.height() * m_scale)* SMALL_H;int wid SMALL_W / m_scale;int hei SMALL_H / m_scale;outPut小矩形坐标及大小(m_x ,m_y ,wid ,hei);//换成qDebug输出QRect rect(x,y,wid,hei);emit signalDrawRect(rect); } connect(this,chunzhongForm::signalDrawRect,dlg,BreviaryDlg::slot_setRectSize);//缩略图窗口类BreviaryDlg void BreviaryDlg::slot_setRectSize(QRect rect) {m_rect rect;scene-onSetPreviewRect(rect); }//缩略图中的自定义场景 void MyGraphicsScene::onSetPreviewRect(QRect rect) {m_rectSaved rect;// 内缩几个像素用矩形外边框来标示viewport显示区域m_pRectItem-setRect(rect.x() - 2/* 5*/, rect.y() - 2/* 5*/, rect.width() - 4, rect.height() - 4);//设置图形项矩形 }下面贴出自定义场景类 MyGraphicsScene.h #pragma once//#include vld.h #include QGraphicsSceneclass MyGraphicsScene : public QGraphicsScene {Q_OBJECTpublic:MyGraphicsScene(QObject *parent nullptr);virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);virtual void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent);Q_SIGNALS:void previewRectMoved(QRect rect);public Q_SLOTS:void onSetPreviewRect(QRect rect);private:QGraphicsRectItem* m_pRectItem;QRect m_rectSaved;bool m_bRectClicked;QPoint m_ptRectRelated; // 鼠标点击时相对于红色矩形框的位置 };MyGraphicsScene.cpp #include MyGraphicsScene.h #include QGraphicsSceneMouseEvent #include QGraphicsRectItem #include QDebugMyGraphicsScene::MyGraphicsScene(QObject *parent): QGraphicsScene(parent), m_bRectClicked(false) {m_pRectItem new QGraphicsRectItem(0, 0, 0, 0);QPen penRectItem QPen(QColor(255, 0, 0));penRectItem.setWidth(2);m_pRectItem-setPen(penRectItem);m_pRectItem-setZValue(1);addItem(m_pRectItem); }void MyGraphicsScene::onSetPreviewRect(QRect rect) {m_rectSaved rect;// 内缩几个像素用矩形外边框来标示viewport显示区域m_pRectItem-setRect(rect.x() - 2/* 5*/, rect.y() - 2/* 5*/, rect.width() - 4, rect.height() - 4); }void MyGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) {QGraphicsScene::mouseMoveEvent(mouseEvent);if (m_bRectClicked) {QPoint ptTopLeft mouseEvent-scenePos().toPoint() - m_ptRectRelated;m_rectSaved.setTopLeft(ptTopLeft); // qDebug()mouseMoveEvent;emit previewRectMoved(m_rectSaved);} }void MyGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) {QGraphicsScene::mousePressEvent(mouseEvent);if (m_rectSaved.contains(mouseEvent-scenePos().x(), mouseEvent-scenePos().y())) {m_bRectClicked true;m_ptRectRelated mouseEvent-scenePos().toPoint() - m_rectSaved.topLeft();} }void MyGraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) {QGraphicsScene::mouseReleaseEvent(mouseEvent);m_bRectClicked false; }
http://www.pierceye.com/news/904696/

相关文章:

  • 中国银行全球门户网站wordpress 分类下排序
  • 网站费用怎么做帐张北网站建设
  • 郑州专业网站制作泉州网络推广专员
  • 此网站可能有优化大师班级
  • 用html表格做的网站钦州建站哪家好
  • 做任务可以给钱的网站ps怎么做电商网站
  • 建设单位网站的重要性设计官网需要留言吗
  • 网站推广关键词排名优化做网站虚拟主机和云服务器吗
  • seo如何推广网站深圳网站的做网站公司
  • 架设网站是自己架设服务器还是租服务器佛山网站排名推广
  • 西安做网站哪家最便宜win系统的wordpress
  • 饲料网站源码3号台风最新消息
  • 天津 公司网站建设优化网站内容的方法
  • 网站 例能加速浏览器的加速器
  • 黄埔营销型网站建设山东诚铭建设机械有限公司网站
  • 东莞网站建设dgjcwlwordpress添加活动
  • 广州互邦物流网络优化建站关于网站开发的请示
  • 贵阳手机银行app论坛seo招聘
  • 太原建设北路小学网站铜仁市网站建设
  • 网站换服务器怎么做哪个公司做公司网站好
  • 东莞营销网站建设报价阿里云服务器部署网站
  • 品牌企业建站如何建设网站兴田德润简介呢
  • 思行做网站北京西站到大兴机场
  • 长沙网页制作模板的网站c++编程软件
  • 网站备案 人工审核安卓软件下载安装
  • 网站建设公司 专题制作怎么注册订阅号
  • 网站运营内容包含哪些深圳标本制作
  • wordpress 微信导航站南昌有哪些企业网站
  • 网站开发需要的人员南京手机网站
  • 上海网站建设知识 博客网站建设数据库的购买