• pyqt4桌面软件各种画布组合结构实例


    import sys
    reload(sys)
    sys.setdefaultencoding('utf8')
    from PyQt4 import QtGui, QtCore
    
    try:
    from PyQt4.QtCore import QString
    except ImportError:
    QString = type('')
    from PyQt4.QtGui import *
    from PyQt4.QtGui import QDialog, QToolBox, QTabWidget, QLabel, QVBoxLayout, QPushButton, QLineEdit
    from PyQt4.QtCore import Qt, QDir, SIGNAL, SLOT
    from PyQt4.QtGui import QFileDialog
    
     
    
    class SelectChartArea(QDialog):
    def __init__(self, parent=None):
    super(SelectChartArea, self).__init__(parent)
    self.listWidget = QListWidget()
    self.listWidget.insertItem(0, u"")
    self.listWidget.insertItem(1, u"")
    self.listWidget.insertItem(2, u"")
    self.label1 = QLabel(u"!")
    self.pixMap = QPixmap("./pic/zhe.png") 
    self.label1.setPixmap(self.pixMap)
    self.label2 = QLabel(u"!")
    self.label3 = QLabel(u"!")
    
    self.stack = QStackedWidget()
    self.stack.addWidget(self.label1)
    self.stack.addWidget(self.label2)
    self.stack.addWidget(self.label3)
    
    self.mainLayout = QHBoxLayout(self)
    self.mainLayout.setMargin(0)
    self.mainLayout.setSpacing(0)
    self.mainLayout.addWidget(self.listWidget)
    self.mainLayout.addWidget(self.stack, 0, Qt.AlignHCenter)
    self.mainLayout.setStretchFactor(self.listWidget, 1)
    self.mainLayout.setStretchFactor(self.stack, 3)
    self.connect(self.listWidget, SIGNAL("currentRowChanged(int)"), self.stack, SLOT("setCurrentIndex(int)"))
    
    
    class CahrtTab(QToolBox):
    label = '板'
    
    def __init__(self, parent=None):
    super(CahrtTab, self).__init__(parent)
    
    self.btn1 = SelectChartArea()
    self.groupbox1 = QtGui.QGroupBox()
    self.vlayout1 = QtGui.QVBoxLayout(self.groupbox1)
    self.vlayout1.addWidget(self.btn1)
    self.addItem(self.groupbox1, u">>板")
    
    self.btn2 = CustomChartArea()
    self.groupbox2 = QtGui.QGroupBox()
    self.vlayout2 = QtGui.QVBoxLayout(self.groupbox2)
    self.vlayout2.addWidget(self.btn2)
    self.addItem(self.groupbox2, u">>板")
    
    
    class CustomChartArea(QToolBox):
    def __init__(self, parent=None):
    super(CustomChartArea, self).__init__(parent)
    self.btn2 = QtGui.QToolButton()
    self.btn2.setText(u"2")
    
    
    ##########
    
    ########### GenrateTabe
    class GenrateTabe(QDialog):
    label = '出'
    
    def __init__(self, parent=None):
    super(GenrateTabe, self).__init__(parent)
    self.setGeometry(600, 100, 415, 650)
    label0 = QLabel(u"设置:")
    oneLayout = QVBoxLayout()
    oneLayout.addWidget(label0)
    label1 = QPushButton(u"板:")
    label2 = QLabel(u"置:")
    label3 = QPushButton(u"置:")
    label4 = QPushButton(u"存储路径:")
    label1right = QLineEdit()
    label2right = QLineEdit()
    label3right = QLineEdit()
    label4right = QLineEdit()
    secondLayout = QGridLayout()
    secondLayout.addWidget(label1, 0, 0)
    secondLayout.addWidget(label1right, 0, 1)
    secondLayout.addWidget(label2, 1, 0)
    secondLayout.addWidget(label2right, 1, 1)
    secondLayout.addWidget(label3, 2, 0)
    secondLayout.addWidget(label3right, 2, 1)
    secondLayout.addWidget(label4, 3, 0)
    secondLayout.addWidget(label4right, 3, 1)
    
    btnbegin = QPushButton(u"生成")
    btncancel = QPushButton(u"取消")
    buttonLayout = QHBoxLayout()
    buttonLayout.addStretch(1)
    buttonLayout.addWidget(btnbegin)
    buttonLayout.addWidget(btncancel)
    mainLayout = QGridLayout(self)
    mainLayout.addLayout(oneLayout, 0, 0)
    mainLayout.addLayout(secondLayout, 1, 0)
    mainLayout.addLayout(buttonLayout, 2, 0)
    mainLayout.setSizeConstraint(QLayout.SetFixedSize)
    
    
    ###########
    

      

    好好学习-天天撸码
  • 相关阅读:
    postgresql 的统计信息
    postgresql 查看表、列的备注信息
    redis 4.0.9 cluster + startup stop
    redis 4.0.9 cluster + failover
    oracle ebs r12 打补丁的步骤
    centos 7.4 + redis 4.0.9 cluster + make
    pgpool running mode
    pgpool + streaming replication mode + slave down up
    pgpool 的安装之一
    postgresql 函数的三个状态
  • 原文地址:https://www.cnblogs.com/stevenshushu/p/6847190.html
Copyright © 2020-2023  润新知