最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

pyqt4教程之messagebox使用示例分享

 更新時(shí)間:2014年03月07日 10:33:18   作者:  
這篇文章主要介紹了pyqt4的messagebox使用示例,需要的朋友可以參考下

復(fù)制代碼 代碼如下:

#coding=utf-8
#對(duì)話框
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_()

相關(guān)文章

  • python3整數(shù)反轉(zhuǎn)的實(shí)現(xiàn)方法

    python3整數(shù)反轉(zhuǎn)的實(shí)現(xiàn)方法

    這篇文章主要介紹了python3整數(shù)反轉(zhuǎn)的實(shí)現(xiàn)方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-04-04
  • 使用Python+Splinter自動(dòng)刷新12306火車票

    使用Python+Splinter自動(dòng)刷新12306火車票

    一年一度的春運(yùn)又來(lái)了,今年我自己寫了個(gè)搶票腳本,下面小編給大家分享使用Python+Splinter自動(dòng)刷新12306火車票,需要的朋友參考下吧
    2018-01-01
  • Python使用Webargs實(shí)現(xiàn)簡(jiǎn)化Web應(yīng)用程序的參數(shù)處理

    Python使用Webargs實(shí)現(xiàn)簡(jiǎn)化Web應(yīng)用程序的參數(shù)處理

    在開發(fā)Web應(yīng)用程序時(shí),參數(shù)處理是一個(gè)常見的任務(wù),Python的Webargs模塊為我們提供了一種簡(jiǎn)單而強(qiáng)大的方式來(lái)處理這些參數(shù),下面我們就來(lái)學(xué)習(xí)一下具體操作吧
    2024-02-02
  • VScode查看python f.write()的文件亂碼問(wèn)題及解決方法

    VScode查看python f.write()的文件亂碼問(wèn)題及解決方法

    這篇文章主要介紹了VScode查看python f.write()的文件亂碼問(wèn)題及解決方法,本文通過(guò)圖文并茂的形式給大家分享解決方法,需要的朋友可以參考下
    2023-02-02
  • python讀取txt文件,去掉空格計(jì)算每行長(zhǎng)度的方法

    python讀取txt文件,去掉空格計(jì)算每行長(zhǎng)度的方法

    今天小編就為大家分享一篇python讀取txt文件,去掉空格計(jì)算每行長(zhǎng)度的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-12-12
  • 用Python搶火車票的簡(jiǎn)單小程序?qū)崿F(xiàn)解析

    用Python搶火車票的簡(jiǎn)單小程序?qū)崿F(xiàn)解析

    這篇文章主要介紹了用Python搶火車票的簡(jiǎn)單小程序?qū)崿F(xiàn)解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-08-08
  • Python3指定路徑尋找符合匹配模式文件

    Python3指定路徑尋找符合匹配模式文件

    這篇文章主要介紹了Python3指定路徑尋找符合匹配模式文件,涉及Python文件查找與模式匹配的相關(guān)技巧,需要的朋友可以參考下
    2015-05-05
  • Python查找算法之分塊查找算法的實(shí)現(xiàn)

    Python查找算法之分塊查找算法的實(shí)現(xiàn)

    這篇文章主要介紹了Python查找算法之分塊查找算法的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-04-04
  • python提取頁(yè)面內(nèi)url列表的方法

    python提取頁(yè)面內(nèi)url列表的方法

    這篇文章主要介紹了python提取頁(yè)面內(nèi)url列表的方法,涉及Python操作頁(yè)面元素的相關(guān)技巧,需要的朋友可以參考下
    2015-05-05
  • 詳解Python3定時(shí)器任務(wù)代碼

    詳解Python3定時(shí)器任務(wù)代碼

    這篇文章主要介紹了Python3定時(shí)器任務(wù)代碼,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2019-09-09

最新評(píng)論

和硕县| 龙海市| 平和县| 迭部县| 南丰县| 西畴县| 五家渠市| 金堂县| 娄烦县| 隆尧县| 连云港市| 南阳市| 阿拉善左旗| 宁明县| 玉环县| 张掖市| 萝北县| 华亭县| 土默特右旗| 顺义区| 蓝山县| 稻城县| 阿合奇县| 尼玛县| 芜湖县| 金阳县| 云浮市| 青冈县| 惠水县| 杭锦后旗| 绍兴市| 香河县| 南雄市| 巫山县| 道孚县| 文安县| 万安县| 巴林左旗| 罗城| 东方市| 凌云县|