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


Python QtWidgets.QHBoxLayout方法代碼示例

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


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

示例1: __init__

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def __init__(self, **kwds):
        super(VectorInputWidget, self).__init__(**kwds)
        self.setLayout(QtWidgets.QHBoxLayout())
        self.layout().setContentsMargins(1, 1, 1, 1)
        self.layout().setSpacing(1)
        self.dsbX = pyf_Slider(self, "float", style=0, name="x")
        self.dsbY = pyf_Slider(self, "float", style=0, name="y")
        self.dsbZ = pyf_Slider(self, "float", style=0, name="z")
        self.layout().addWidget(self.dsbX)
        self.layout().addWidget(self.dsbY)
        self.layout().addWidget(self.dsbZ)

        self._configSpinBoxes()
        self.dsbX.valueChanged.connect(self._onDataChangedX)
        self.dsbY.valueChanged.connect(self._onDataChangedY)
        self.dsbZ.valueChanged.connect(self._onDataChangedZ) 
開發者ID:microelly2,項目名稱:NodeEditor,代碼行數:18,代碼來源:PinInputWidgetFactory.py

示例2: __init__

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def __init__(self, label, widget, parent=None, hideLabel=False, maxLabelWidth=None, toolTip=""):
        super(PropertyEntry, self).__init__(parent)
        self.label = label
        self.layout = QtWidgets.QHBoxLayout(self)
        self.layout.setContentsMargins(1, 1, 1, 1)
        if not hideLabel:
            label = QtWidgets.QLabel(label + ":")
            label.setStyleSheet("font: bold")
            label.setToolTip(toolTip)
            if not maxLabelWidth:
                label.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred))
            else:
                label.setMaximumWidth(maxLabelWidth)
            self.layout.addWidget(label)
        self.layout.addWidget(widget)
        self.index = -1 
開發者ID:wonderworks-software,項目名稱:PyFlow,代碼行數:18,代碼來源:PropertiesFramework.py

示例3: setupUi

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(228, 30)
        self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
        self.horizontalLayout.setSpacing(1)
        self.horizontalLayout.setContentsMargins(1, 1, 1, 1)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.widget = QtWidgets.QWidget(Form)
        self.widget.setObjectName("widget")
        self.horizontalLayout.addWidget(self.widget)
        self.labelName = QtWidgets.QLabel(Form)
        self.labelName.setObjectName("labelName")
        self.horizontalLayout.addWidget(self.labelName)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.pbKill = QtWidgets.QPushButton(Form)
        self.pbKill.setMaximumSize(QtCore.QSize(40, 16777215))
        self.pbKill.setText("")
        self.pbKill.setObjectName("pbKill")
        self.horizontalLayout.addWidget(self.pbKill)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
開發者ID:wonderworks-software,項目名稱:PyFlow,代碼行數:25,代碼來源:VariableForm_ui.py

示例4: setupUi

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def setupUi(self, QSpectrumAnalyzerBaseline):
        QSpectrumAnalyzerBaseline.setObjectName("QSpectrumAnalyzerBaseline")
        QSpectrumAnalyzerBaseline.resize(500, 100)
        self.verticalLayout = QtWidgets.QVBoxLayout(QSpectrumAnalyzerBaseline)
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtWidgets.QFormLayout()
        self.formLayout.setObjectName("formLayout")
        self.label = QtWidgets.QLabel(QSpectrumAnalyzerBaseline)
        self.label.setObjectName("label")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.baselineFileEdit = QtWidgets.QLineEdit(QSpectrumAnalyzerBaseline)
        self.baselineFileEdit.setObjectName("baselineFileEdit")
        self.horizontalLayout.addWidget(self.baselineFileEdit)
        self.baselineFileButton = QtWidgets.QToolButton(QSpectrumAnalyzerBaseline)
        self.baselineFileButton.setMinimumSize(QtCore.QSize(50, 0))
        self.baselineFileButton.setObjectName("baselineFileButton")
        self.horizontalLayout.addWidget(self.baselineFileButton)
        self.formLayout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout)
        self.verticalLayout.addLayout(self.formLayout)
        spacerItem = QtWidgets.QSpacerItem(20, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.buttonBox = QtWidgets.QDialogButtonBox(QSpectrumAnalyzerBaseline)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)
        self.label.setBuddy(self.baselineFileEdit)

        self.retranslateUi(QSpectrumAnalyzerBaseline)
        self.buttonBox.accepted.connect(QSpectrumAnalyzerBaseline.accept)
        self.buttonBox.rejected.connect(QSpectrumAnalyzerBaseline.reject)
        QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerBaseline)
        QSpectrumAnalyzerBaseline.setTabOrder(self.baselineFileEdit, self.baselineFileButton) 
開發者ID:xmikos,項目名稱:qspectrumanalyzer,代碼行數:37,代碼來源:ui_qspectrumanalyzer_baseline.py

示例5: __init__

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def __init__(self, parent=None):
        super(ReplacePath, self).__init__(parent)
        self.resize(500, 100)
        self.setWindowTitle('Replace Read Node Path')
        self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint)
        main_layout = QtGui.QVBoxLayout(self)
        main_layout.setSpacing(15)

        source_label = QtGui.QLabel('Source Path')
        self.source_le = QtGui.QLineEdit()
        target_label = QtGui.QLabel('Target Path')
        self.target_le = QtGui.QLineEdit()
        self.replace_btn = QtGui.QPushButton('Replace')
        self.replace_btn.clicked.connect(self.do_replace)

        source_layout = QtGui.QHBoxLayout()
        source_layout.addWidget(source_label)
        source_layout.addWidget(self.source_le)

        target_layout = QtGui.QHBoxLayout()
        target_layout.addWidget(target_label)
        target_layout.addWidget(self.target_le)

        main_layout.addLayout(source_layout)
        main_layout.addLayout(target_layout)
        main_layout.addWidget(self.replace_btn) 
開發者ID:weijer,項目名稱:NukeToolSet,代碼行數:28,代碼來源:replace_read_node_path.py

示例6: __makeWidgets

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def __makeWidgets(self):
        main_layout = QtWidgets.QHBoxLayout()
        self.setLayout(main_layout)

        self.__back_button = QtWidgets.QPushButton()
        self.__next_button = QtWidgets.QPushButton()
        self.__back_button.setObjectName("medic_browser_back")
        self.__next_button.setObjectName("medic_browser_next")

        main_layout.addWidget(self.__back_button)
        main_layout.addWidget(self.__next_button)
        main_layout.setSpacing(1)

        self.__back_button.clicked.connect(self.BackClicked.emit)
        self.__next_button.clicked.connect(self.NextClicked.emit) 
開發者ID:sol-ansano-kim,項目名稱:medic,代碼行數:17,代碼來源:widgets.py

示例7: __setParameters

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def __setParameters(self, params):
        self.__param_container = params
        for info in params.getParamInfos():
            p_name, p_label, p_type, p_default = info
            widget, function = ParameterFunctions.CreateWidget(info)
            if widget:
                layout = QtWidgets.QHBoxLayout()
                label = QtWidgets.QLabel(p_label)
                label.setObjectName("parameter_label")
                layout.addWidget(label)
                layout.addWidget(widget)

                self.__params.append({"name": p_name, "widget": widget, "function": function})
                self.__qt_parameter_layout.addLayout(layout) 
開發者ID:sol-ansano-kim,項目名稱:medic,代碼行數:16,代碼來源:widgets.py

示例8: __init__

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def __init__(self, name, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.name = name
        self.parent = parent

        self.graph_scene = Scene(parent=self.parent,
                                 nodegraph_widget=self)
        self.graph_view = View(self.graph_scene, parent=self.parent)
        self.horizontal_layout = QtWidgets.QHBoxLayout(self)
        self.horizontal_layout.addWidget(self.graph_view) 
開發者ID:dsideb,項目名稱:nodegraph-pyqt,代碼行數:12,代碼來源:main_perftest.py

示例9: __init__

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def __init__(self, parent=None, dataSetCallback=None, defaultValue=None, **kwds):
        super(InputWidgetSingle, self).__init__(parent=parent, dataSetCallback=dataSetCallback,
                                                defaultValue=defaultValue, **kwds)
        self.horizontalLayout = QHBoxLayout(self)
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        self._index = 0
        self._widget = None
        self.senderPin = None 
開發者ID:wonderworks-software,項目名稱:PyFlow,代碼行數:11,代碼來源:InputWidgets.py

示例10: showPropertyEditor

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def showPropertyEditor(self):
        tree = EditPropertiesTreeWidget()
        count = self.contentLayout.count()
        folders = {}
        for i in range(count):
            item = self.contentLayout.itemAt(i)
            w = item.widget()        
            if w:
                if w.title() in  ["Inputs"]:
                    for key,group in w.groups.items():
                        if key not in folders:
                            folders[key] = {}
                        #for e in range(group.groupLayout.count()):
                        #    w = group.groupLayout.itemAt(e).widget()
                        #    folders[key][w.getLabel()] = group.groupLayout.itemAt(e).widget()

        for fold in folders:
            folder = tree.addFolder(fold)
            #for widg in folders[fold]:
            #    child = tree.addNormal(widg,folder)

        d = QtWidgets.QDialog()
        d.setLayout(QtWidgets.QHBoxLayout())
        d.layout().addWidget(tree)
        d.exec_()
        newOrder = tree.model_to_dict() 
開發者ID:wonderworks-software,項目名稱:PyFlow,代碼行數:28,代碼來源:PropertiesFramework.py

示例11: setupUi

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(341, 363)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setSpacing(1)
        self.verticalLayout.setContentsMargins(1, 1, 1, 1)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.pbNewVar = QtWidgets.QPushButton(Form)
        self.pbNewVar.setMaximumSize(QtCore.QSize(50, 16777215))
        self.pbNewVar.setObjectName("pbNewVar")
        self.horizontalLayout.addWidget(self.pbNewVar)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.wListWidget = QtWidgets.QWidget(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.wListWidget.sizePolicy().hasHeightForWidth())
        self.wListWidget.setSizePolicy(sizePolicy)
        self.wListWidget.setObjectName("wListWidget")
        self.gridLayout = QtWidgets.QGridLayout(self.wListWidget)
        self.gridLayout.setContentsMargins(1, 1, 1, 1)
        self.gridLayout.setObjectName("gridLayout")
        self.lytListWidget = QtWidgets.QVBoxLayout()
        self.lytListWidget.setContentsMargins(0, 0, 0, 0)
        self.lytListWidget.setObjectName("lytListWidget")
        self.gridLayout.addLayout(self.lytListWidget, 0, 0, 1, 1)
        self.verticalLayout.addWidget(self.wListWidget)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
開發者ID:wonderworks-software,項目名稱:PyFlow,代碼行數:39,代碼來源:VariablesWidget_ui.py

示例12: test_load_ui_existingLayoutOnDialog

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def test_load_ui_existingLayoutOnDialog():
    """Tests to see if loading a ui onto a layout in a Dialog works"""
    import sys
    from Qt import QtWidgets, QtCompat

    msgs = 'QLayout: Attempting to add QLayout "" to QDialog ' \
        '"Dialog", which already has a layout'

    with ignoreQtMessageHandler([msgs]):
        app = QtWidgets.QApplication(sys.argv)
        win = QtWidgets.QDialog()
        QtWidgets.QComboBox(win)
        QtWidgets.QHBoxLayout(win)
        QtCompat.loadUi(self.ui_qdialog, win)
    app.exit() 
開發者ID:mottosso,項目名稱:Qt.py,代碼行數:17,代碼來源:tests.py

示例13: test_load_ui_existingLayoutOnMainWindow

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def test_load_ui_existingLayoutOnMainWindow():
    """Tests to see if loading a ui onto a layout in a MainWindow works"""
    import sys
    from Qt import QtWidgets, QtCompat

    msgs = 'QLayout: Attempting to add QLayout "" to QMainWindow ' \
        '"", which already has a layout'

    with ignoreQtMessageHandler([msgs]):
        app = QtWidgets.QApplication(sys.argv)
        win = QtWidgets.QMainWindow()
        QtWidgets.QComboBox(win)
        QtWidgets.QHBoxLayout(win)
        QtCompat.loadUi(self.ui_qmainwindow, win)
    app.exit() 
開發者ID:mottosso,項目名稱:Qt.py,代碼行數:17,代碼來源:tests.py

示例14: test_load_ui_existingLayoutOnDockWidget

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def test_load_ui_existingLayoutOnDockWidget():
    """Tests to see if loading a ui onto a layout in a DockWidget works"""
    import sys
    from Qt import QtWidgets, QtCompat

    msgs = 'QLayout: Attempting to add QLayout "" to QDockWidget ' \
        '"", which already has a layout'

    with ignoreQtMessageHandler([msgs]):
        app = QtWidgets.QApplication(sys.argv)
        win = QtWidgets.QDockWidget()
        QtWidgets.QComboBox(win)
        QtWidgets.QHBoxLayout(win)
        QtCompat.loadUi(self.ui_qdockwidget, win)
    app.exit() 
開發者ID:mottosso,項目名稱:Qt.py,代碼行數:17,代碼來源:tests.py

示例15: test_load_ui_existingLayoutOnWidget

# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QHBoxLayout [as 別名]
def test_load_ui_existingLayoutOnWidget():
    """Tests to see if loading a ui onto a layout in a Widget works"""
    import sys
    from Qt import QtWidgets, QtCompat

    msgs = 'QLayout: Attempting to add QLayout "" to QWidget ' \
        '"Form", which already has a layout'

    with ignoreQtMessageHandler([msgs]):
        app = QtWidgets.QApplication(sys.argv)
        win = QtWidgets.QWidget()
        QtWidgets.QComboBox(win)
        QtWidgets.QHBoxLayout(win)
        QtCompat.loadUi(self.ui_qwidget, win)
    app.exit() 
開發者ID:mottosso,項目名稱:Qt.py,代碼行數:17,代碼來源:tests.py


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