# -*- coding: utf-8 -*-

# python:2.x

__author__ = 'Administrator'

import sys

from PyQt4.QtCore import Qt

from PyQt4 import QtGui,QtCore,Qt

from about import Ui_Form

class Example(QtGui.QDialog,Ui_Form):

def __init__(self,parnet=None):

super(Example, self).__init__(parnet)

self.setupUi(self)

self.pushButton.clicked.connect(self.about1)

self.pushButton_2.clicked.connect(self.about2)

def about2(self):

url=QtGui.QLabel(u'<a href=http://weibo.com/fangjiayu1107/home?wvr=5&lf=reg>微博在线</a>',self)

abot_1=QtGui.QMessageBox(self)

abot_1.setWindowTitle(u'关于本工具及作者')

abot_1.setText(u'本工具是由pyqt4软件进行制件的一款菜鸟级别的播放器。\n'

u'是bug大菜鸟所制作。\n\t'

u'\t在制作当中经常修改,\n'

u'在这先谢谢大家支持本工具了,\n'

u'%s'%(url.linkActivated.connect(self.openurl))

)

icon=QtGui.QPixmap('a.jpg')

abot_1.setIconPixmap(icon)

abot_1.show()

def openurl(self,url):

QtGui.QDesktopServices.openUrl(QtCore.QUrl(unicode(url)))

def about1(self):

abc=QtGui.QMessageBox(self)

abc.setWindowTitle(u'提示')

abc.setIconPixmap(QtGui.QPixmap('a.jpg'))

Yes=abc.addButton(u'是的',QtGui.QMessageBox.ActionRole)

abc.setText(u'自定义')

abc.exec_()

button=abc.clickedButton()

if button==Yes:

print 'ok'

self.close()

def main():

app = QtGui.QApplication(sys.argv)

ex = Example()

ex.show()

sys.exit(app.exec_())

main()

如图:

pyqt 自定义例子学习的更多相关文章

  1. pyqt QTreeWidget例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import  * from Py ...

  2. pyqt columnView例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import  * from Py ...

  3. pyqt QTableView例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import  * from Py ...

  4. pyqt QTableWidget例子学习(重点)

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import * from PyQ ...

  5. pyqt 托盘例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import * from PyQ ...

  6. pyqt 正则表达式例子学习

    def rex01(self): username=QtCore.QRegExp('[a-zA-Z0-9_]{2,10}') self.names.setValidator(QtGui.QRegExp ...

  7. pyqt tabWidget例子学习1

    from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT impor ...

  8. pyqt 配置文件例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' import sys,datetime from PyQt4.QtC ...

  9. PyQt(Python+Qt)学习随笔:Designer中的QDialogButtonBox增加自定义按钮的方法

    在Qt Designer中可以预先定义标准按钮,相关支持的标准按钮请见<PyQt(Python+Qt)学习随笔:Designer中的QDialogButtonBox的StandardButton ...

随机推荐

  1. (转载)图片左右滚动控件(带倒影)——重写Gallery

    今天在网上找了些资料,做了一个图片左右滚动的Demo,类似幻灯片播放,同时,图片带倒影效果,运行效果如下图: 实现方式是重写Gallery,使用自定义的Gallery来实现这一效果,工程一共三个文件, ...

  2. unity3d 学习笔记(一)

    操作:按下shit 点击坐标轴中心 切换透视图 动画烘焙的概念:相当于把原来的控制器动画或者IK(骨骼)动画所有塌陷为逐帧动画,导出的时候必须选这一项 着色器:从技术的角度来看,着色器是渲染器的一个部 ...

  3. Oracle—RMAN备份(一)

    一.RMAN备份相关概念 1.RMAN备份中表空间不需要处于backup模式下,它备份数据文件,归档日志文件,控制文件,spfile和备份集片,但不备份联机重做日志文件,临时文件和口令文件. 2.备份 ...

  4. wlan0 Interface doesn't support scanning : Device or resource busy

    Problem: wlan0 Interface doesn't support scanning : Device or resource busy. Solved Way: sudo ifcong ...

  5. SQL函数简述

    数字函数ABS 取绝对值 POWER 乘方 LN 10为底数取幂SQRT 平方根 EXP e的n次乘方 LOG(m,n) m为底数n取幂数学运算函数:ACOS ATAN ATAN2 COS COSH ...

  6. centos6.5配置无线网络

    由于安装的是服务器版,所以开机无法连接网络,以下这些情况都是针对驱动已经安装OK.按步骤操作如下(以下操作默认都是在超级管理员权限下进行): 1.测试电脑是否安装wpa_supplicant,测试方法 ...

  7. Stm32高级定时器(二)

    Stm32高级定时器(二) 1 主从模式:主?从? 谈论主从,可知至少有两个以上的触发或者驱动信号,stm32内部有多个定时器,可以相互之间驱动或者控制. 主模式:定时器使能只受驱动时钟控制或者输出控 ...

  8. asp.net实现将网页内容输出到word并下载到本地

    个人觉得要实现这个功能如果没有类库提供的几个关键函数,还是比较繁琐的.所以首先介绍几个将要在代码中使用的关键函数和参数,然后再说函数实现.注意问题等. 关键函数: 1.函数原型:Response.Ap ...

  9. WebApi2官网学习记录---批量处理HTTP Message

    原文:Batching Handler for ASP.NET Web API 自定义实现HttpMessageHandler public class BatchHandler : HttpMess ...

  10. Codeforces round #353div2 C

    题目来源:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=117863#problem/C 题目大意:给你n个数字,代表这个人在n个银行里面 ...