當前位置: 首頁>>代碼示例>>Python>>正文


Python QtGui.QHBoxLayout方法代碼示例

本文整理匯總了Python中PyQt4.QtGui.QHBoxLayout方法的典型用法代碼示例。如果您正苦於以下問題:Python QtGui.QHBoxLayout方法的具體用法?Python QtGui.QHBoxLayout怎麽用?Python QtGui.QHBoxLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt4.QtGui的用法示例。


在下文中一共展示了QtGui.QHBoxLayout方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setupUi

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def setupUi(self):
        self.connectLayout = QHBoxLayout(self)
        self.connectLayout.setSizeConstraint(QLayout.SetDefaultConstraint)
        self.avatarLB = QLabel(self)
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.avatarLB.sizePolicy().hasHeightForWidth())
        self.avatarLB.setSizePolicy(sizePolicy)
        self.avatarLB.setFixedSize(24, 24)
        self.avatarLB.hide()

        self.nameLB = QLabel(self)
        self.nameLB.setFocusPolicy(Qt.ClickFocus)
        self.nameLB.setTextFormat(Qt.RichText)
        self.nameLB.setText("<html><head/><body><p><span style=\"text-decoration: underline; color:#00557f;\">Add Connection</span></p></body></html>")

        self.setCursor(QCursor(Qt.PointingHandCursor))
        self.connectLayout.addWidget(self.avatarLB)
        self.connectLayout.addWidget(self.nameLB) 
開發者ID:gkudos,項目名稱:qgis-cartodb,代碼行數:22,代碼來源:CartoDBToolbar.py

示例2: __init__

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def __init__(self, ecuscanner):
        super(Ecu_finder, self).__init__()
        self.ecuscanner = ecuscanner
        layoutv = widgets.QVBoxLayout()
        layouth = widgets.QHBoxLayout()
        self.setLayout(layoutv)
        layoutv.addLayout(layouth)
        self.ecuaddr = widgets.QLineEdit()
        self.ecuident = widgets.QLineEdit()
        layouth.addWidget(widgets.QLabel("Addr :"))
        layouth.addWidget(self.ecuaddr)
        layouth.addWidget(widgets.QLabel("ID frame :"))
        layouth.addWidget(self.ecuident)
        button = widgets.QPushButton("VALIDATE")
        layouth.addWidget(button)
        button.clicked.connect(self.check) 
開發者ID:cedricp,項目名稱:ddt4all,代碼行數:18,代碼來源:ddt4all.py

示例3: __init__

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def __init__(self, parent=None):
        super(buttonEditor, self).__init__(parent)
        self.ecurequestsparser = None

        self.layout = None
        self.layouth = widgets.QHBoxLayout()
        self.buttontable = widgets.QTableWidget()
        self.layoutv = widgets.QVBoxLayout()

        self.layouth.addWidget(self.buttontable)
        self.layouth.addLayout(self.layoutv)

        self.buttondata = buttonData()
        self.layoutv.addWidget(self.buttondata)

        self.setLayout(self.layouth)

        self.buttontable.setFixedWidth(250)
        self.buttontable.setColumnCount(2)
        self.buttontable.verticalHeader().hide()
        self.buttontable.setSelectionBehavior(widgets.QAbstractItemView.SelectRows)
        self.buttontable.setSelectionMode(widgets.QAbstractItemView.SingleSelection)
        #self.buttontable.setShowGrid(False)
        self.buttontable.itemSelectionChanged.connect(self.selection_changed)
        self.enable_view(False) 
開發者ID:cedricp,項目名稱:ddt4all,代碼行數:27,代碼來源:dataeditor.py

示例4: setupUi

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(400, 300)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.textEdit = QtGui.QTextEdit(Dialog)
        self.textEdit.setReadOnly(True)
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.verticalLayout.addWidget(self.textEdit)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.ExitButton = QtGui.QPushButton(Dialog)
        self.ExitButton.setObjectName(_fromUtf8("ExitButton"))
        self.horizontalLayout.addWidget(self.ExitButton)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
開發者ID:yasoob,項目名稱:youtube-dl-GUI,代碼行數:24,代碼來源:licenseDialog.py

示例5: initUi

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def initUi(self):
        """"""
        self.setWindowTitle(u'測試')

        buttonAccount = QtGui.QPushButton(u'查詢賬戶')
        buttonInvestor = QtGui.QPushButton(u'查詢投資者')
        buttonPosition = QtGui.QPushButton(u'查詢持倉')

        buttonAccount.clicked.connect(self.__mainEngine.getAccount)
        buttonInvestor.clicked.connect(self.__mainEngine.getInvestor)
        buttonPosition.clicked.connect(self.__mainEngine.getPosition)

        hBox = QtGui.QHBoxLayout()
        hBox.addWidget(buttonAccount)
        hBox.addWidget(buttonInvestor)
        hBox.addWidget(buttonPosition)

        self.setLayout(hBox)


######################################################################## 
開發者ID:sunshinelover,項目名稱:chanlun,代碼行數:23,代碼來源:demoUi.py

示例6: initUi

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def initUi(self, startDate=None):
        """初始化界麵"""
        self.setWindowTitle(u'Price')

        self.vbl_1 = QtGui.QVBoxLayout()
        self.initplotTick()  # plotTick初始化

        self.vbl_2 = QtGui.QVBoxLayout()
        self.initplotKline()  # plotKline初始化
        self.initplotTendency()  # plot分時圖的初始化

        # 整體布局
        self.hbl = QtGui.QHBoxLayout()
        self.hbl.addLayout(self.vbl_1)
        self.hbl.addLayout(self.vbl_2)
        self.setLayout(self.hbl)

        self.initHistoricalData()  # 下載曆史數據

    #---------------------------------------------------------------------- 
開發者ID:sunshinelover,項目名稱:chanlun,代碼行數:22,代碼來源:uiBasicWidget修改.py

示例7: __init__

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def __init__(self, parent=None):
        super(FlatCAMActivityView, self).__init__(parent=parent)

        self.setMinimumWidth(200)

        self.icon = QtGui.QLabel(self)
        self.icon.setGeometry(0, 0, 12, 12)
        self.movie = QtGui.QMovie("share/active.gif")
        self.icon.setMovie(self.movie)
        #self.movie.start()

        layout = QtGui.QHBoxLayout()
        layout.setContentsMargins(5, 0, 5, 0)
        layout.setAlignment(QtCore.Qt.AlignLeft)
        self.setLayout(layout)

        layout.addWidget(self.icon)
        self.text = QtGui.QLabel(self)
        self.text.setText("Idle.")

        layout.addWidget(self.text) 
開發者ID:Denvi,項目名稱:FlatCAM,代碼行數:23,代碼來源:FlatCAMGUI.py

示例8: quickLayout

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:19,代碼來源:universal_tool_template_1116.py

示例9: __init__

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def __init__(self, *args):
        QtWidgets.QFrame.__init__(self, *args)
 
        self.setFrameStyle(QtWidgets.QFrame.StyledPanel | QtWidgets.QFrame.Sunken)
 
        self.edit = self.PlainTextEdit()
        self.number_bar = self.NumberBar(self.edit)
 
        hbox = QtWidgets.QHBoxLayout(self)
        hbox.setSpacing(0)
        hbox.setContentsMargins(0,0,0,0) # setMargin
        hbox.addWidget(self.number_bar)
        hbox.addWidget(self.edit)
 
        self.edit.blockCountChanged.connect(self.number_bar.adjustWidth)
        self.edit.updateRequest.connect(self.number_bar.updateContents) 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:18,代碼來源:LNTextEdit.py

示例10: __init__

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def __init__(self, *args):
        QtGui.QFrame.__init__(self, *args)
 
        self.setFrameStyle(QtGui.QFrame.StyledPanel | QtGui.QFrame.Sunken)
 
        self.edit = self.PlainTextEdit()
        self.number_bar = self.NumberBar(self.edit)
 
        hbox = QtGui.QHBoxLayout(self)
        hbox.setSpacing(0)
        hbox.setContentsMargins(0,0,0,0) # setMargin
        hbox.addWidget(self.number_bar)
        hbox.addWidget(self.edit)
 
        self.edit.blockCountChanged.connect(self.number_bar.adjustWidth)
        self.edit.updateRequest.connect(self.number_bar.updateContents) 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:18,代碼來源:LNTextEdit_v3.2.py

示例11: quickLayout

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def quickLayout(self, type, ui_name=""):
        the_layout = QtGui.QVBoxLayout()
        if type == "form":
            the_layout = QtGui.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)    
        elif type == "grid":
            the_layout = QtGui.QGridLayout()
        elif type == "hbox":
            the_layout = QtGui.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtGui.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:19,代碼來源:UITranslator_v1.0.py

示例12: quickLayout

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtGui.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtGui.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtGui.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtGui.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:19,代碼來源:universal_tool_template_v7.3.py

示例13: setupUi

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def setupUi(self, ImgurClientIdDialog):
        ImgurClientIdDialog.setObjectName(_fromUtf8("ImgurClientIdDialog"))
        ImgurClientIdDialog.resize(754, 467)
        self.gridLayout_2 = QtGui.QGridLayout(ImgurClientIdDialog)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.enterClientIdBtn = QtGui.QPushButton(ImgurClientIdDialog)
        self.enterClientIdBtn.setObjectName(_fromUtf8("enterClientIdBtn"))
        self.gridLayout_2.addWidget(self.enterClientIdBtn, 3, 0, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.label_2 = QtGui.QLabel(ImgurClientIdDialog)
        self.label_2.setTextFormat(QtCore.Qt.RichText)
        self.label_2.setOpenExternalLinks(True)
        self.label_2.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.horizontalLayout_2.addWidget(self.label_2)
        self.gridLayout_2.addLayout(self.horizontalLayout_2, 0, 0, 1, 2)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label = QtGui.QLabel(ImgurClientIdDialog)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.clientIdLineEdit = QtGui.QLineEdit(ImgurClientIdDialog)
        self.clientIdLineEdit.setObjectName(_fromUtf8("clientIdLineEdit"))
        self.horizontalLayout.addWidget(self.clientIdLineEdit)
        self.gridLayout_2.addLayout(self.horizontalLayout, 2, 0, 1, 2)
        self.enterLaterBtn = QtGui.QPushButton(ImgurClientIdDialog)
        self.enterLaterBtn.setObjectName(_fromUtf8("enterLaterBtn"))
        self.gridLayout_2.addWidget(self.enterLaterBtn, 3, 1, 1, 1)

        self.retranslateUi(ImgurClientIdDialog)
        QtCore.QMetaObject.connectSlotsByName(ImgurClientIdDialog) 
開發者ID:NSchrading,項目名稱:redditDataExtractor,代碼行數:34,代碼來源:imgurClientId_auto.py

示例14: setupUi

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(820, 650)
        MainWindow.setAutoFillBackground(False)
        MainWindow.setDocumentMode(False)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(-1, -1, 0, 0)
        self.horizontalLayout.setSpacing(10)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.btnAdd = QtGui.QPushButton(self.centralwidget)
        self.btnAdd.setObjectName(_fromUtf8("btnAdd"))
        self.horizontalLayout.addWidget(self.btnAdd)
        self.chkMore = QtGui.QCheckBox(self.centralwidget)
        self.chkMore.setObjectName(_fromUtf8("chkMore"))
        self.horizontalLayout.addWidget(self.chkMore)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.matplotlibwidget = MatplotlibWidget(self.centralwidget)
        self.matplotlibwidget.setObjectName(_fromUtf8("matplotlibwidget"))
        self.verticalLayout.addWidget(self.matplotlibwidget)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow) 
開發者ID:swharden,項目名稱:Python-GUI-examples,代碼行數:32,代碼來源:ui_main.py

示例15: setupUi

# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QHBoxLayout [as 別名]
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(993, 692)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.pbLevel = QtGui.QProgressBar(self.centralwidget)
        self.pbLevel.setMaximum(1000)
        self.pbLevel.setProperty("value", 123)
        self.pbLevel.setTextVisible(False)
        self.pbLevel.setOrientation(QtCore.Qt.Vertical)
        self.pbLevel.setObjectName(_fromUtf8("pbLevel"))
        self.horizontalLayout.addWidget(self.pbLevel)
        self.frame = QtGui.QFrame(self.centralwidget)
        self.frame.setFrameShape(QtGui.QFrame.NoFrame)
        self.frame.setFrameShadow(QtGui.QFrame.Plain)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.verticalLayout = QtGui.QVBoxLayout(self.frame)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(self.frame)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label)
        self.grFFT = PlotWidget(self.frame)
        self.grFFT.setObjectName(_fromUtf8("grFFT"))
        self.verticalLayout.addWidget(self.grFFT)
        self.label_2 = QtGui.QLabel(self.frame)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout.addWidget(self.label_2)
        self.grPCM = PlotWidget(self.frame)
        self.grPCM.setObjectName(_fromUtf8("grPCM"))
        self.verticalLayout.addWidget(self.grPCM)
        self.horizontalLayout.addWidget(self.frame)
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow) 
開發者ID:swharden,項目名稱:Python-GUI-examples,代碼行數:40,代碼來源:ui_main.py


注:本文中的PyQt4.QtGui.QHBoxLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。