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

推广项目网站html编辑器有哪些

推广项目网站,html编辑器有哪些,专业团队是什么意思,wordpress进不去后台提要 继承QPushButton后的按钮#xff0c;设置其样式。 实现 在自定义的控件类中添加Q_OBJECT宏 在自定义的控件的类中重写paintevent函数 自定义的控件在使用时#xff0c;必须指明其父对象 使用样式表设置样式#xff0c;将类名改为自定义的类名 例子 直接上代码 myB…提要 继承QPushButton后的按钮设置其样式。 实现 在自定义的控件类中添加Q_OBJECT宏 在自定义的控件的类中重写paintevent函数 自定义的控件在使用时必须指明其父对象 使用样式表设置样式将类名改为自定义的类名 例子 直接上代码 myButton.h #ifndef MYBUTTON_H #define MYBUTTON_H#include QWidget #include QPushButtonclass myButton : public QPushButton {Q_OBJECT public:myButton(int index,QWidget *parent nullptr);~myButton();int getIndex();//获取按钮的下标void setSceneBtnId(int id);//设置场景按钮的idvoid setSceneBtnName(QString name);//设置场景按钮的名字void setSceneBtnNameId(int id,QString name);//设置场景按钮idint getSceneBtnId();//获取场景按钮idQString getScenBtnName();//获取场景按钮的名称void initBtnStyle();//设置按钮样式void getAdjustScreenRatio();//获取屏幕分辨率 public slots:void slot_setSceneBtnName(QString strName);//设置场景按钮的名称void slot_setSceneBtnId(int id);//设置场景按钮id protected:void paintEvent(QPaintEvent *e);void mousePressEvent(QMouseEvent *e); private:int m_index;//按钮的下标用于区别点击的是哪个按钮int m_id;//按钮的idQString m_strName;//按钮的名称 }; #endif // MYBUTTON_HmyButton.cpp #include mybutton.h //#include screenresolution.h #include QMouseEvent #include QStyleOption #include QBitmap #include QPixmap #include QPaintermyButton::myButton(int index,QWidget *parent) :QPushButton(parent),m_index(index) {initBtnStyle(); }myButton::~myButton() {}int myButton::getIndex() {return m_index; }void myButton::setSceneBtnId(int id) {m_id id; }void myButton::setSceneBtnName(QString name) {m_strName name; }void myButton::setSceneBtnNameId(int id, QString name) {m_id id;m_strName name; }int myButton::getSceneBtnId() {return m_id; }QString myButton::getScenBtnName() {return m_strName; }void myButton::getAdjustScreenRatio() {}void myButton::initBtnStyle() {QPixmap pixmap;QBitmap bit;pixmap.load(:/new/prefix1/images/sceneBtn.png);pixmap pixmap.scaled(QSize(181 ,74),Qt::KeepAspectRatio);setFixedSize(pixmap.size());bit pixmap.mask();setMask(bit);this-setStyleSheet(myButton{background-color:transparent;border-image: url(:/new/prefix1/images/sceneBtn.png);border: 1px solid #0D79FF;opacity: 0.7;font-size: 18px;font-family: Microsoft YaHei;font-weight: 400;color: #FFFFFF;}myButton:pressed{border-image: url(:/new/prefix1/images/sysbtnPressed.png);font-size: 18px;font-family: Microsoft YaHei;font-weight: 400;color: rgba(255, 255, 255, 0.8);line-height: 18px;}); }void myButton::slot_setSceneBtnName(QString strName) {m_strName strName; }void myButton::slot_setSceneBtnId(int id) {m_id id; }void myButton::paintEvent(QPaintEvent *e) {Q_UNUSED(e);QStyleOption opt;opt.init(this);QPainter p(this);style()-drawPrimitive(QStyle::PE_Widget, opt, p, this);QPushButton::paintEvent(e); }void myButton::mousePressEvent(QMouseEvent *e) {if(e-button() Qt::RightButton){//创建编辑框若已经创建则直接显示,绑定编辑框与按钮来存储修改的信息}QPushButton::mousePressEvent(e); }以上就是自定义控件的类其使用如下附上关键代码 myButton *btn new myButton(0, this);//指出父类btn-setText(自定义类);btn-setGeometry(0,0,200,200);以上就是自定义控件样式的设置。由于我重写鼠标点击事件的时候忘记了父类的鼠标点击事件导致事件没有传递下去从而没有出现点击后的效果纠结了许久终得解决。
http://www.zqtcl.cn/news/186422/

相关文章:

  • 广州建设手机网站wordpress 外部链接跳转
  • 传播公司可以做门户网站吗深圳常平网站建设制作公司
  • 最好的网站设计公司源码 php多平台网站建设
  • 下载了网站源码施工企业质量管理体系应按照我国
  • 有关网站建设国内外现状的文献英文谷歌seo
  • 珠海做网站哪间好佛山网站建设骏域
  • 免费网站建设支持ftp网络规划设计师资格证
  • 网站打开文件按钮怎么做十大网络游戏
  • 问答类咨询网站的建设烟台开发区做网站
  • 网站域名费用怎么做分录销售crm客户管理系统
  • 海南住房与城乡建设网站大连做网站团队
  • 邯郸最穷的三个县长春纯手工seo
  • 昌黎网站建设贵德县建设局网站
  • 山西网站制作公司兼职做网站安全么
  • 阿里做网站怎么做青岛网站维护
  • 怎么建网站手机版郑州网站建设哪家好
  • 做企业网站有哪些好处安龙网站建设
  • 怎做连接网站wordpress iis设置方法
  • ugc网站开发网站设计常见流程
  • dz论坛可以做招聘网站国内空间没备案可以打开网站吗
  • 建设用地规划证查询网站公司起名字大全免费好听
  • 杭州网站建设公司有哪些瑞诺国际的数字营销模式
  • 宣城网站建设 有限公司高州做网站
  • 做外贸最适合的网站系统有可以做国外支付系统的网站吗
  • 建设执业资格注册中心网站办事大厅ui设计素材库
  • 个人网站免费建站4399电脑版网页链接
  • 重庆开县网站建设公司推荐网站建设与维护高职
  • 关于网站开发的技术博客海口网站设计建设
  • xx市院门户网站建设方案做视频特技的网站
  • 肇庆seo公司咨询23火星seo 网站