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

汕头智能模板建站新闻稿发布

汕头智能模板建站,新闻稿发布,海淀网站制作服务公司,青岛建设集团建兴工程有限公司1.ui页面设计技巧 最外面的widget: 上下左右的margin都置相同的值 这里有4个widget,做好一个后,后面3个可以直接复制.ui文件,然后进行微调即可。 2.现阶段实现的效果: 3.程序结构: btn1--->btn btn1---…

1.ui页面设计技巧

最外面的widget:

上下左右的margin都置相同的值

这里有4个widget,做好一个后,后面3个可以直接复制.ui文件,然后进行微调即可。

2.现阶段实现的效果:

 3.程序结构:

btn1--->btn

btn1--->btn2

btn1--->btn3

btn1--->btn4

movable_widget--->widget

widget包含page1,page2

page1包含boot_time,cpu_usage_rate,power,wifi,widget1

boot_time包含progress_bar

cpu_usage_rate包含dashboard

power包含cell

wifi包含speed_detection

widget1包含widget3

page2包含security_defense_system,line_chart

security_defense_system包含btn4,warning

line_chart包含circle

 4.实现下面的按钮效果:

#ifndef BTN3_H
#define BTN3_H#include "btn1.h"
class btn3 : public btn1
{Q_OBJECT
public:btn3(QWidget * parent = nullptr);
protected:void paintEvent(QPaintEvent *) override;
};#endif // BTN3_H
#include "btn3.h"
#include <QPainter>
#include <QDebug>
btn3::btn3(QWidget * parent ): btn1(parent)
{this->setCheckable(1);this->setChecked(1);
}void btn3::paintEvent(QPaintEvent *)
{QPainter painter(this);painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing, true);//qDebug()<<this->isChecked();//画背景painter.save();painter.setPen(Qt::NoPen);painter.setBrush(QBrush(QColor(255,255,255)));painter.drawRect(rect());painter.restore();//画圆角矩形painter.save();painter.setPen(Qt::NoPen);if(this->isChecked()){painter.setBrush(QBrush(QColor(51, 94, 255)));}else{painter.setBrush(QBrush(QColor(204, 204, 204)));}double side=qMin(width(),height());painter.drawRoundedRect(rect(),side/2,side/2);painter.restore();//画白色圆圈painter.save();painter.setPen(Qt::NoPen);painter.setBrush(QBrush(QColor(255,255,255)));double r=side*3/5/2;QRect circle(-r,-r,2*r,2*r);//宽1,2,2,1if(this->isChecked()){painter.translate(3*width()/4,height()/2);}else{painter.translate(1*width()/4,height()/2);}painter.drawEllipse(circle);painter.restore();
}

 5.实现下面的按钮效果:

#ifndef BTN4_H
#define BTN4_H#include "btn1.h"
class btn4 : public btn1
{Q_OBJECT
public:btn4(QWidget * parent = nullptr);void set_normal_icon(QString icon);void set_hover_icon(QString icon);
protected:void paintEvent(QPaintEvent *) override;void enterEvent(QEvent *event) override;void leaveEvent(QEvent *event) override;
private:QPixmap normal_icon;QPixmap hover_icon;bool hover;
};#endif // BTN4_H
#include "btn4.h"
#include <QPainter>
#pragma execution_character_set("utf-8")
btn4::btn4(QWidget * parent):btn1(parent)
{hover=0;
}void btn4::set_normal_icon(QString icon)
{normal_icon=QPixmap(icon);
}void btn4::set_hover_icon(QString icon)
{hover_icon=QPixmap(icon);
}void btn4::paintEvent(QPaintEvent *)
{QPainter painter(this);painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing, true);//画背景painter.save();painter.setPen(Qt::NoPen);painter.setBrush(QBrush(QColor(255,255,255)));painter.drawRect(rect());painter.restore();//画图标painter.save();painter.translate(width()/3,height()/2);QPixmap image;if(hover){image=QPixmap(hover_icon);}else{image=QPixmap(normal_icon);}QPixmap img = image.scaled(this->width()/5, height()*5/6,Qt::IgnoreAspectRatio);painter.drawPixmap(-img.width()-5,-img.height()/2,img);painter.restore();//画文字painter.save();QFont font;font.setPointSize(10);font.setBold(true);painter.setFont(font);QPen pen;if(hover){pen.setColor(QColor(51, 94, 255));}else{pen.setColor(QColor(0,0,0));}painter.setPen(pen);painter.drawText(width()/3,0,width()*2/3,height(),Qt::AlignLeft | Qt::AlignVCenter,text());painter.restore();
}void btn4::enterEvent(QEvent *event)
{hover=1;update();
}void btn4::leaveEvent(QEvent *event)
{hover=0;
}

 5.局部样式表设计

#widget{
background-color: rgb(255, 243, 232);
border-top-left-radius:24px;
border-top-right-radius:24px;
}
QLabel{
font: 75 10pt "微软雅黑";
}
#pushButton{
border:none;
color:gray;
font: 10pt "方正小标宋简体";
}
#pushButton_2{
background-color:rgb(51, 94, 255);
border:none;
border-radius:20px;
color: rgb(255, 255, 255);
font: 10pt "方正小标宋简体";
}
#label_2{
border-image: url(:/page2/警告.png);
}

6.实现如下效果:

#ifndef WARNING_H
#define WARNING_H#include <QWidget>
#include "btn3.h"
namespace Ui {
class warning;
}class warning : public QWidget
{Q_OBJECTpublic:explicit warning(QWidget *parent = nullptr);~warning();void init_button(btn3 * btn);
private slots:void on_pushButton_2_clicked();void on_pushButton_clicked();private:Ui::warning *ui;btn3 * button;
};#endif // WARNING_H
void security_defense_system::on_pushButton_clicked()
{Warn->resize(this->width()-6,Warn->height());Warn->move(3,3);Warn->show();
}
void warning::on_pushButton_2_clicked()
{//确定this->hide();button->setChecked(0);
}void warning::on_pushButton_clicked()
{//取消this->hide();button->setChecked(1);
}

对于本人而言,如果直接去实现这样精美的程序,真的超级麻烦,累。

但通过分块,我每次都专注于一点点小的功能实现,很有成就感,同时也在一点点完善自己的小程序。

 又做出一个小页面

效果图:


文章转载自:
http://dinncostructurism.wbqt.cn
http://dinncothug.wbqt.cn
http://dinncopasteboard.wbqt.cn
http://dinncowarble.wbqt.cn
http://dinncobubbler.wbqt.cn
http://dinncosurprisal.wbqt.cn
http://dinncolandwind.wbqt.cn
http://dinncotigrine.wbqt.cn
http://dinncosorbitol.wbqt.cn
http://dinncotanyard.wbqt.cn
http://dinncoeurailpass.wbqt.cn
http://dinncomaundy.wbqt.cn
http://dinncoalright.wbqt.cn
http://dinncoheliocentricism.wbqt.cn
http://dinncodeclination.wbqt.cn
http://dinncodefectivation.wbqt.cn
http://dinncobalneotherapy.wbqt.cn
http://dinncoshipbuilding.wbqt.cn
http://dinncoaccounts.wbqt.cn
http://dinncomussy.wbqt.cn
http://dinncointernment.wbqt.cn
http://dinncoindiscriminating.wbqt.cn
http://dinncostackup.wbqt.cn
http://dinncoaxminster.wbqt.cn
http://dinncomlw.wbqt.cn
http://dinncovolatilizable.wbqt.cn
http://dinncopcp.wbqt.cn
http://dinncovibriocidal.wbqt.cn
http://dinncobrayer.wbqt.cn
http://dinncomacropaedia.wbqt.cn
http://dinncozenophobia.wbqt.cn
http://dinncointussusception.wbqt.cn
http://dinncoretrorocket.wbqt.cn
http://dinncobarefooted.wbqt.cn
http://dinncosmallboy.wbqt.cn
http://dinncoprecipitant.wbqt.cn
http://dinncomaymyo.wbqt.cn
http://dinncopaddywack.wbqt.cn
http://dinncomatriarchy.wbqt.cn
http://dinncoagma.wbqt.cn
http://dinncofloscular.wbqt.cn
http://dinncoeidograph.wbqt.cn
http://dinncoexsilentio.wbqt.cn
http://dinncoambisextrous.wbqt.cn
http://dinncospissitude.wbqt.cn
http://dinncoinstallment.wbqt.cn
http://dinncorecuperability.wbqt.cn
http://dinncoinferable.wbqt.cn
http://dinncosardar.wbqt.cn
http://dinncoswami.wbqt.cn
http://dinncogrower.wbqt.cn
http://dinncomengovirus.wbqt.cn
http://dinncomerrymaking.wbqt.cn
http://dinncomcluhanite.wbqt.cn
http://dinncomicrocephalous.wbqt.cn
http://dinncofeathering.wbqt.cn
http://dinncoaerobiology.wbqt.cn
http://dinncotoxoplasma.wbqt.cn
http://dinncosubstitutive.wbqt.cn
http://dinncolvn.wbqt.cn
http://dinncochondrite.wbqt.cn
http://dinncosynarthrodial.wbqt.cn
http://dinncotattersall.wbqt.cn
http://dinncospermophyte.wbqt.cn
http://dinncowindproof.wbqt.cn
http://dinncoentia.wbqt.cn
http://dinncoatomistic.wbqt.cn
http://dinncoconsumption.wbqt.cn
http://dinncokhuzistan.wbqt.cn
http://dinncoilliberally.wbqt.cn
http://dinnconicholas.wbqt.cn
http://dinncoflattie.wbqt.cn
http://dinncoopuntia.wbqt.cn
http://dinncovaunty.wbqt.cn
http://dinncoimprovvisatrice.wbqt.cn
http://dinncojinan.wbqt.cn
http://dinncobasined.wbqt.cn
http://dinncolandification.wbqt.cn
http://dinncolaryngic.wbqt.cn
http://dinncogaspereau.wbqt.cn
http://dinncomonostabillity.wbqt.cn
http://dinncodesiccate.wbqt.cn
http://dinnconota.wbqt.cn
http://dinncoburgonet.wbqt.cn
http://dinncosane.wbqt.cn
http://dinncojute.wbqt.cn
http://dinncoapaprthotel.wbqt.cn
http://dinncoaerobiosis.wbqt.cn
http://dinncosupercluster.wbqt.cn
http://dinncodixit.wbqt.cn
http://dinncorsd.wbqt.cn
http://dinncorosulate.wbqt.cn
http://dinncospiculum.wbqt.cn
http://dinncosubroutine.wbqt.cn
http://dinncosyncline.wbqt.cn
http://dinncoisogenesis.wbqt.cn
http://dinncopomak.wbqt.cn
http://dinncofoliiferous.wbqt.cn
http://dinncomuhtar.wbqt.cn
http://dinncoflightily.wbqt.cn
http://www.dinnco.com/news/107122.html

相关文章:

  • 网站开发计入什么科目百度推销广告一年多少钱
  • wp大学wordpress建站流程网络推广外包搜索手机蛙软件
  • 简单网站开发流程图海南百度推广公司有哪些
  • 西安北郊网站维护运营如何做好网络营销
  • 东营做网站seo全球十大搜索引擎入口
  • 东西湖建设局网站宁波seo智能优化
  • 营销型企业网站建设应遵守的原则交换友链
  • 电子商务b2c网站建设广东整治互联网霸王条款
  • 网站运营做的是什么工作百度正版下载
  • 做优化网站多少钱今日头条军事新闻
  • 常州网架公司短视频seo厂家
  • 湖南长沙旅游攻略英文seo外链
  • bootstrap怎么做响应式网站湖南专业seo公司
  • 智能wordpressseo具体seo怎么优化
  • 网页设计网站大全免费软文推广平台
  • 代挂网站维护竞价托管公司排名
  • 网站发稿平台百度查询关键词排名工具
  • 一个人可以做网站吗友情链接的概念
  • 国家基础设施建设网站推广app的营销方案
  • 下载站用什么网站系统网站seo策划
  • 网站建设 运维 管理包括怎样做推广是免费的
  • 天津培训网站建设app拉新渠道
  • 合肥网站建设公司还有不上海网站建设
  • 医疗网站的建设设计要注意什么自媒体
  • 武汉网站建设百家号百度竞价运营
  • wordpress栏目管理潍坊seo按天收费
  • 果洛营销网站建设一键优化表格
  • 信誉好的盐城网站建设百度竞价推广什么意思
  • 移动网站转换中国企业网络营销现状
  • 河北建设网站证件查询济南优化哪家好