360关于我们

#!/usr/bin/python  
#-*-coding:utf-8-*-

from push_button import PushButton
import util
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.Qt import *


class AboutUsDialog(QDialog):
	def __init__(self,parent = None):
		super(AboutUsDialog,self).__init__(parent)
				
		self.title_label = QLabel(self)
		self.title_label.setFixedHeight(30)
		self.title_label.setStyleSheet("color:white")
		
		self.title_icon_label = QLabel(self)
		self.title_icon_label.setPixmap(QPixmap("./img/safe.ico"))
		self.title_icon_label.setFixedSize(16, 16)
		self.title_icon_label.setScaledContents(True)
		
		self.close_button = PushButton()
		self.close_button.loadPixmap("./img/sysButton/close.png")
		
		self.title_info_label =  QLabel(self)
		self.title_info_label.setStyleSheet("color:rgb(30,170,60)")
		self.title_info_label.setFont(QFont("微软雅黑", 14, QFont.Bold, False))
		
		self.info_label  = QLabel(self)
		self.info_label.setContentsMargins(0, 0, 0, 40)
		self.info_label.setStyleSheet("color:rgb(30,170,60)")
		self.info_label.setFont(QFont("微软雅黑", 10, QFont.Bold, False))
		self.info_label.setContentsMargins(0, 0, 0, 40)
		
		self.version_label = QLabel(self)		
		
		self.mummy_label = QLabel(self)
		
		self.copyright_label = QLabel(self)
		self.copyright_label.setStyleSheet("color:gray")
		
		self.icon_label =  QLabel(self)
		self.pixmap = QPixmap ("./img/360safe.png")
		self.icon_label.setPixmap(self.pixmap)
		self.icon_label.setFixedSize(self.pixmap.size())
		
		self.ok_button = QPushButton(self)
		self.ok_button.setFixedSize(75, 25)
		self.ok_button.setStyleSheet("QPushButton{border:1px solid lightgray background:rgb(230,230,230)}"
			"QPushButton.hover{border-color:green background:transparent}")
					
		self.setWindowFlags(Qt.FramelessWindowHint | Qt.Dialog)
		
		#布局标题		
		self.title_layout = QHBoxLayout()
		self.title_layout.addWidget(self.title_icon_label,0,Qt.AlignVCenter)
		self.title_layout.addWidget(self.title_icon_label, 0, Qt.AlignVCenter)
		self.title_layout.addWidget(self.title_label, 0,  Qt.AlignVCenter)
		self.title_layout.addStretch() #平均
		self.title_layout.addWidget(self.close_button, 0,  Qt.AlignTop)
		
		#布局信息列表
		self.v1_layout = QVBoxLayout()
		self.v1_layout.addWidget(self.title_info_label)
		self.v1_layout.addWidget(self.info_label)
		self.v1_layout.setSpacing(10)

		self.v2_layout = QVBoxLayout()
		self.v2_layout.addWidget(self.version_label)
		self.v2_layout.addWidget(self.mummy_label)
		self.v2_layout.addWidget(self.copyright_label)
		self.v2_layout.setSpacing(10)
		
		self.v_layout =  QVBoxLayout()
		self.v_layout.addLayout(self.v1_layout)
		self.v_layout.addLayout(self.v2_layout)
		self.v_layout.addStretch() #平均分配
		self.v_layout.setSpacing(50)
		self.v_layout.setContentsMargins(0, 15, 0, 0) #设置距离边界的值

		#布局地下配置
		self.bottom_layout =  QHBoxLayout()
		self.bottom_layout.addStretch()
		self.bottom_layout.addWidget(self.ok_button)
		self.bottom_layout.setSpacing(0)
		self.bottom_layout.setContentsMargins(0, 0, 30, 20)
	
		self.h_layout =  QHBoxLayout()
		self.h_layout.addLayout(self.v_layout)
		self.h_layout.addWidget(self.icon_label)
		self.h_layout.setSpacing(0)
		self.h_layout.setContentsMargins(40, 0, 20, 10)
	
		self.main_layout =  QVBoxLayout()
		self.main_layout.addLayout(self.title_layout)
		self.main_layout.addStretch()
		self.main_layout.addLayout(self.h_layout)
		self.main_layout.addLayout(self.bottom_layout)
		self.main_layout.setSpacing(0)
		self.main_layout.setContentsMargins(0, 0, 0, 0)
	
		self.setLayout(self.main_layout)
		
		
		self.title_layout.setSpacing(0)
		self.title_layout.setContentsMargins(10, 0, 5, 0)
				
		self.translateLanguage()
		self.resize(520,290)
		
		self.connect(self.ok_button, SIGNAL("clicked()"), SLOT("hide()"))
		self.connect(self.close_button,SIGNAL("clicked()"),SLOT("close()"))
	
	def paintEvent(self,event):
		#self.sking_name = QString()
		self.painter = QPainter()
		self.painter2 = QPainter()
		self.painter3 = QPainter()
		
		self.painter.begin(self)
		self.painter.drawPixmap(self.rect(),QPixmap("./img/skin/17_big.jpg"))
		self.painter.end()
		linear2 = QLinearGradient(self.rect().topLeft(),self.rect().bottomLeft())
		linear2.start()
		linear2.setColorAt(0, Qt.white)
		linear2.setColorAt(0.5, Qt.white)
		linear2.setColorAt(1, Qt.white)
		linear2.finalStop()
		self.painter2.begin(self)
		self.painter2.setPen(Qt.white) #设定画笔颜色,到时侯就是边框颜色
		self.painter2.setBrush(linear2);
		self.painter2.drawRect(QRect(0, 30, self.width(), self.height()-30));
		self.painter2.end()
		
		
		self.painter3.begin(self)
		self.painter3.setPen(Qt.gray)
		self.painter3.drawPolyline(QPointF(0, 30), QPointF(0, self.height()-1), QPointF(self.width()-1, self.height()-1), QPointF(self.width()-1, 30))
		self.painter3.end()
		
		 
		
		
	def translateLanguage(self):
		self.title_label.setText(u"360安全卫士")
		self.title_info_label.setText(u"360安全卫士")
		self.info_label.setText(u"杀木马 防盗号 电脑加速")
		self.version_label.setText(u"主程序版本:9.1.0.2002")
		self.mummy_label.setText(u"备用木马库:2013-8-19")
		self.copyright_label.setText(u"Copyright(c) 360.cn Inc.All Rights Reserved.")
		#self.close_button.setToolTip(self.tr("close"))
		self.ok_button.setText(u"确定")
		
	def mousePressEvent(self,event):
		if event.button() == Qt.LeftButton:
			self.dragPosition = event.globalPos() - self.frameGeometry().topLeft()
			event.accept()

	def mouseMoveEvent(self,event):
		if event.buttons() == Qt.LeftButton:
			self.move(event.globalPos() - self.dragPosition)
			event.accept()
									
			

if __name__ == '__main__':
	
	import sys
	app = QApplication(sys.argv)
	aboutus = AboutUsDialog()
	aboutus.show()
	sys.exit(app.exec_())	


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
根据提供的引用内容,我们可以了解到polo360css是一个使用HTML和CSS技术实现的静态页面。具体来说,HTML用于定义页面结构,CSS用于定义页面样式。因此,polo360css主要是通过CSS来实现页面的样式设计。 如果你想了解更多关于CSS的知识,可以参考以下内容: 1. CSS是什么? CSS(Cascading Style Sheets)是一种用于描述HTML或XML等文档样式的语言。它定义了如何显示HTML元素,包括布局、颜色、字体、大小、背景等方面的样式。 2. CSS的基本语法是什么? CSS的基本语法由选择器、属性和值组成。选择器用于选择要应用样式的HTML元素,属性用于定义要修改的样式属性,值用于指定属性的值。例如,以下代码将修改所有p元素的文本颜色为红色: ```css p { color: red; } ``` 3. CSS的样式优先级是如何确定的? 当多个CSS规则应用于同一元素时,浏览器将根据优先级确定应用哪个规则。CSS的优先级由选择器的特殊性和重要性决定。特殊性是指选择器的特殊程度,重要性是指样式表中使用!important声明的规则。 4. CSS的盒模型是什么? CSS的盒模型是指HTML元素在页面中占据的空间。它由内容区域、内边距、边框和外边距组成。内容区域包含元素的实际内容,内边距是内容区域和边框之间的空间,边框是内容区域和外边距之间的空间,外边距是元素和其他元素之间的空间。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值