kimiko老师,2014年春晚小品大全,教育心理学形成性考核册答案
#coding=utf-8
#对话框
import sys
from pyqt4 import qtgui, qtcore
class window( qtgui.qwidget ):
def __init__( self ):
super( window, self ).__init__()
self.setwindowtitle( "hello" )
self.resize( 500, 500 )
gridlayout = qtgui.qgridlayout()
self.aboutbutton = qtgui.qpushbutton( "about" )
gridlayout.addwidget( self.aboutbutton, 0, 0 )
self.aboutqtbutton = qtgui.qpushbutton( "aboutqt" )
gridlayout.addwidget( self.aboutqtbutton, 0, 1 )
self.criticalbutton = qtgui.qpushbutton( "criticalbutton" )
gridlayout.addwidget( self.criticalbutton, 1, 0 )
self.infobutton = qtgui.qpushbutton( "info" )
gridlayout.addwidget( self.infobutton, 1, 1 )
self.questionbutton = qtgui.qpushbutton( "question" )
gridlayout.addwidget( self.questionbutton, 2, 0 )
self.warningbutton = qtgui.qpushbutton( "warning" )
gridlayout.addwidget( self.warningbutton, 2, 1 )
spacer = qtgui.qspaceritem( 200, 80 )
gridlayout.additem( spacer, 3, 1, 1, 5 )
self.setlayout( gridlayout )
self.connect( self.aboutbutton, qtcore.signal( 'clicked()' ), self.onaboutbutton )
self.connect( self.aboutqtbutton, qtcore.signal( 'clicked()' ), self.onaboutqtbutton )
self.connect( self.criticalbutton, qtcore.signal( 'clicked()' ), self.oncriticalbutton )
self.connect( self.infobutton, qtcore.signal( 'clicked()' ), self.oninfobutton )
self.connect( self.questionbutton, qtcore.signal( 'clicked()' ), self.onquestionbutton )
self.connect( self.warningbutton, qtcore.signal( 'clicked()' ), self.onwarningbutton )
def onaboutbutton( self ):
qtgui.qmessagebox.about( self, 'pyqt', "about" )
def onaboutqtbutton( self ):
qtgui.qmessagebox.aboutqt( self, "pyqt" )
def oncriticalbutton( self ):
r = qtgui.qmessagebox.critical( self, "pyqt", "criticalbutton", qtgui.qmessagebox.abort,
qtgui.qmessagebox.retry, qtgui.qmessagebox.ignore )
if r == qtgui.qmessagebox.abort:
self.setwindowtitle( "abort" )
elif r == qtgui.qmessagebox.retry:
self.setwindowtitle( "retry" )
elif r == qtgui.qmessagebox.ignore:
self.setwindowtitle( "ignore" )
else:
pass
def oninfobutton( self ):
qtgui.qmessagebox.information( self, "pyqt", "information" )
def onquestionbutton( self ):
r = qtgui.qmessagebox.question( self, "pyqt", "question", qtgui.qmessagebox.yes, qtgui.qmessagebox.no, qtgui.qmessagebox.cancel )
def onwarningbutton( self ):
r = qtgui.qmessagebox.warning( self, "pyqt", "warning", qtgui.qmessagebox.yes, qtgui.qmessagebox.no )
app = qtgui.qapplication( sys.argv )
win = window()
win.show()
app.exec_()
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
-
python中def是做什么的
python使用def开始函数定义,紧接着是函数名,括号内部为函数的参数,内部为函数的 具体功能实现代码,如果想要函数有返回值, 在expressions中的逻...
[阅读全文]
-
-
-
-
-
-
网友评论