zoukankan      html  css  js  c++  java
  • PyQT_Group

    2016/6/27 10:15:52 PyQT_Group

     
     
    fromPyQt5.QtCoreimport*
    fromPyQt5.QtGuiimport*
    fromPyQt5.QtWidgetsimport*
    
    import sys
    
    
    classWindow(QWidget):
        def __init__(self):
            super(Window, self).__init__()
                self.echoGroup =QGroupBox('Echo')
                self.echoLabel =QLabel('Mode:')
                self.echoComboBox =QComboBox()
                self.echoComboBox.addItem('Normal')
                self.echoComboBox.addItem('Password')
                self.echoComboBox.addItem('PasswordEchoOnEdit')
                self.echoComboBox.addItem('No Echo')
                self.echoLineEdit =QLineEdit()
                self.echoLineEdit.setPlaceholderText('Placeholder Text')
                self.echoLineEdit.setFocus()
                self.echoLayout =QGridLayout()
                self.echoLayout.addWidget(self.echoLabel,0,0)
                self.echoLayout.addWidget(self.echoComboBox,0,1)
                self.echoLayout.addWidget(self.echoLineEdit,1,0,1,2)
                self.echoGroup.setLayout(self.echoLayout)
                self.Layout=QGridLayout()
                self.Layout.addWidget(self.echoGroup,0,0)
                self.setLayout(self.Layout)
                self.setWindowTitle('Qt_Group')
        def echoChanged(self, index):
            if index ==0:
                self.echoLineEdit.setEchoMode(QLineEdit.Normal)
            elif index ==1:
                self.echoLineEdit.setEchoMode(QLineEdit.Password)
            elif index ==2:
                self.echoLineEdit.setEchoMode(QLineEdit.PasswordEchoOnEdit)
            elif index ==3:
                self.echoLineEdit.setEchoMode(QLineEdit.NoEcho)
    app =QApplication(sys.argv)
    win =Window()
    win.show()
    app.exec_()



  • 相关阅读:
    DNS放大攻击
    Java并发编程(四):并发容器(转)
    关注商业价值
    样式小记
    应用程序优化
    查看当前的连接和锁
    重命名你的数据库
    转:对XML插入操作
    对数据的分页再一次思考
    不浪费自己的时间,同时也不浪费别人的时间
  • 原文地址:https://www.cnblogs.com/topshooter/p/python352_pyqt_group.html
Copyright © 2011-2022 走看看