本文整理汇总了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)
示例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
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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
示例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()
示例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)
示例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()
示例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()
示例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()
示例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()