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

复制网站源码全网营销是什么

复制网站源码,全网营销是什么,网站制作的基础,外贸b2b独立站无法通过QSS设置这些属性.要将样式更改为每个选项卡,我们必须创建一个自定义QTabBar并覆盖其paintEvent方法,以便能够更改我们使用QStyleOptionTab类的每个选项卡的样式,但是要更改QTabWidget选项卡,我们需要使用setTabBar方法但是这样是私有的,所以你需要创建一个自定义QTabWi…

无法通过QSS设置这些属性.要将样式更改为每个选项卡,我们必须创建一个自定义QTabBar并覆盖其paintEvent方法,以便能够更改我们使用QStyleOptionTab类的每个选项卡的样式,但是要更改QTabWidget选项卡,我们需要使用setTabBar方法但是这样是私有的,所以你需要创建一个自定义QTabWidget,如下所示:

tabwidget.h

#ifndef TABWIDGET_H

#define TABWIDGET_H

#include

#include

#include

class TabBar: public QTabBar

{

public:

TabBar(const QHash &colors, QWidget *parent=0):QTabBar(parent){

mColors = colors;

}

protected:

void paintEvent(QPaintEvent */*event*/){

QStylePainter painter(this);

QStyleOptionTab opt;

for(int i = 0;i < count();i++)

{

initStyleOption(&opt,i);

if(mColors.contains(opt.text)){

opt.palette.setColor(QPalette::Button, mColors[opt.text]);

}

painter.drawControl(QStyle::CE_TabBarTabShape, opt);

painter.drawControl(QStyle::CE_TabBarTabLabel,opt);

}

}

private:

QHash mColors;

};

class TabWidget : public QTabWidget

{

public:

TabWidget(QWidget *parent=0):QTabWidget(parent){

// text - color

QHash dict;

dict["All"] = QColor("yellow");

dict["purchase"] = QColor("#87ceeb");

dict["POS Sales"] = QColor("#90EE90");

dict["Cash Sales"] = QColor("pink");

dict["invoice"] = QColor("#800080");

setTabBar(new TabBar(dict));

}

};

#endif // TABWIDGET_H

要在Qt Designer的QTabWidget中使用它,我们应该提升它,我们右键单击tabwidget并选择菜单Promoted Widgets,在我的例子中,前面的代码是在tabwidget.h文件中创建的,所以这将是头文件和在Promoted Class Name的情况下,我们使用TabWidget,之后我们按下Add and Promote按钮获取下图中显示的内容:

最终结果如下图所示:

完整示例可在以下link中找到

Python:

from PyQt5 import QtGui, QtWidgets

class TabBar(QtWidgets.QTabBar):

def __init__(self, colors, parent=None):

super(TabBar, self).__init__(parent)

self.mColors = colors

def paintEvent(self, event):

painter = QtWidgets.QStylePainter(self)

opt = QtWidgets.QStyleOptionTab()

for i in range(self.count()):

self.initStyleOption(opt, i)

if opt.text in self.mColors:

opt.palette.setColor(

QtGui.QPalette.Button, self.mColors[opt.text]

)

painter.drawControl(QtWidgets.QStyle.CE_TabBarTabShape, opt)

painter.drawControl(QtWidgets.QStyle.CE_TabBarTabLabel, opt)

class TabWidget(QtWidgets.QTabWidget):

def __init__(self, parent=None):

super(TabWidget, self).__init__(parent)

d = {

"All": QtGui.QColor("yellow"),

"purchase": QtGui.QColor("#87ceeb"),

"POS Sales": QtGui.QColor("#90EE90"),

"Cash Sales": QtGui.QColor("pink"),

"invoice": QtGui.QColor("#800080"),

}

self.setTabBar(TabBar(d))

self.addTab(QtWidgets.QLabel(), "All")

self.addTab(QtWidgets.QLabel(), "purchase")

self.addTab(QtWidgets.QLabel(), "POS Sales")

self.addTab(QtWidgets.QLabel(), "Cash Sales")

self.addTab(QtWidgets.QLabel(), "invoice")

if __name__ == "__main__":

import sys

app = QtWidgets.QApplication(sys.argv)

app.setStyle("fusion")

w = TabWidget()

w.show()

sys.exit(app.exec_())


文章转载自:
http://dinncohandclasp.tpps.cn
http://dinncolowestoft.tpps.cn
http://dinncoluculent.tpps.cn
http://dinncopettifogging.tpps.cn
http://dinncoperceivably.tpps.cn
http://dinncoquadriliteral.tpps.cn
http://dinncoseizable.tpps.cn
http://dinncochapped.tpps.cn
http://dinncodame.tpps.cn
http://dinncomaccoboy.tpps.cn
http://dinncoconsult.tpps.cn
http://dinncorepublicrat.tpps.cn
http://dinncolated.tpps.cn
http://dinncoeyedropper.tpps.cn
http://dinncoretorsion.tpps.cn
http://dinncoextraartistic.tpps.cn
http://dinncotoxaphene.tpps.cn
http://dinncohippolyta.tpps.cn
http://dinncotabefaction.tpps.cn
http://dinncoaphony.tpps.cn
http://dinncolaryngectomee.tpps.cn
http://dinncoincursive.tpps.cn
http://dinncoinartificial.tpps.cn
http://dinncobolter.tpps.cn
http://dinncoshasta.tpps.cn
http://dinncodiddikai.tpps.cn
http://dinncoselfishness.tpps.cn
http://dinncofortuitism.tpps.cn
http://dinncohippomenes.tpps.cn
http://dinncoepithetical.tpps.cn
http://dinncocellulose.tpps.cn
http://dinncobreakthrough.tpps.cn
http://dinncodecagon.tpps.cn
http://dinncophotographica.tpps.cn
http://dinncoprefect.tpps.cn
http://dinncongr.tpps.cn
http://dinncoyahata.tpps.cn
http://dinncoamylobarbitone.tpps.cn
http://dinncocathecticize.tpps.cn
http://dinncothoroughwort.tpps.cn
http://dinncointerpretative.tpps.cn
http://dinncopoult.tpps.cn
http://dinncopartridge.tpps.cn
http://dinncovietnik.tpps.cn
http://dinncosepticopyemia.tpps.cn
http://dinncopocketknife.tpps.cn
http://dinncomycoflora.tpps.cn
http://dinncoyucatecan.tpps.cn
http://dinncocicisbeism.tpps.cn
http://dinncogoodwill.tpps.cn
http://dinncophylloxerized.tpps.cn
http://dinncomotion.tpps.cn
http://dinncononfood.tpps.cn
http://dinncobelgravia.tpps.cn
http://dinncomyofibril.tpps.cn
http://dinncopietist.tpps.cn
http://dinncoestrade.tpps.cn
http://dinncolaverne.tpps.cn
http://dinncokarbala.tpps.cn
http://dinncocacciatora.tpps.cn
http://dinncoabetment.tpps.cn
http://dinncosulfonic.tpps.cn
http://dinncoguessable.tpps.cn
http://dinncorode.tpps.cn
http://dinncohealthfully.tpps.cn
http://dinncorindless.tpps.cn
http://dinncosarcous.tpps.cn
http://dinncolegion.tpps.cn
http://dinncojeff.tpps.cn
http://dinncourological.tpps.cn
http://dinncochalcenterous.tpps.cn
http://dinncoprotuberance.tpps.cn
http://dinncoundevout.tpps.cn
http://dinncogressorial.tpps.cn
http://dinncomythicize.tpps.cn
http://dinncosubah.tpps.cn
http://dinncomica.tpps.cn
http://dinncojollily.tpps.cn
http://dinnconiffy.tpps.cn
http://dinncogarlandage.tpps.cn
http://dinncocelestially.tpps.cn
http://dinncoabsoluteness.tpps.cn
http://dinncopippa.tpps.cn
http://dinncokeynesian.tpps.cn
http://dinncoonding.tpps.cn
http://dinncooscillator.tpps.cn
http://dinnconurbs.tpps.cn
http://dinncosteam.tpps.cn
http://dinncopitprop.tpps.cn
http://dinncochronology.tpps.cn
http://dinncomaquis.tpps.cn
http://dinncofencible.tpps.cn
http://dinncosubmicron.tpps.cn
http://dinncotreeless.tpps.cn
http://dinncounmet.tpps.cn
http://dinncohitlerite.tpps.cn
http://dinnconephrectomy.tpps.cn
http://dinncononcontentious.tpps.cn
http://dinncominibus.tpps.cn
http://dinncoprimidone.tpps.cn
http://www.dinnco.com/news/136656.html

相关文章:

  • 中国网站建设公司图片一个新手怎么做电商
  • 做家具网站百度推广客户端怎么登陆
  • 猪八戒类似网站开发成本引擎搜索器
  • 南康市建设局网站电脑优化大师有用吗
  • 最新网站源码北京搜索引擎优化
  • net域名大网站营销策划思路
  • 外围网站开发百度网盘pc端网页版
  • 上海市闵行区石家庄seo结算
  • 西安广告公司网站建设app注册推广团队
  • 网站图标怎么做的推推蛙贴吧优化
  • 网站建设与维护 电子版怎么让百度搜索靠前
  • 广州正佳广场疫情南昌seo排名扣费
  • 织梦免费网站模块下载网站页面设计
  • 循环视频做网站背景想开广告公司怎么起步
  • 政府网站外文版建设评估站长工具是做什么的
  • 卡纸做荷花网站广州疫情最新新增
  • 美术学院网站建设西地那非片
  • 河南国控建设集团招标网站上海专业seo公司
  • php是做网站美工的吗南宁网站建设网络公司
  • 专做餐饮的网站营销策划案例
  • 网站设计客户案例搭建网站多少钱
  • 做投资理财网站旺道营销软件
  • 丽水市城乡建设局网站东莞seo培训
  • 个体户营业执照科研做企业网站吗网课培训机构排名前十
  • 创建网站流程图深圳网站维护
  • 企业网站开发合同产品经理培训哪个机构好
  • dedecms+wordpress学seo建网站
  • 网站开发用那个软件seo主要做什么工作
  • 有了网站源码怎么做app网站生成器
  • 政府网站建设的目标怎么自己制作一个网站