本文整理汇总了Python中python_qt_binding.QtGui.QVBoxLayout.setMargin方法的典型用法代码示例。如果您正苦于以下问题:Python QVBoxLayout.setMargin方法的具体用法?Python QVBoxLayout.setMargin怎么用?Python QVBoxLayout.setMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类python_qt_binding.QtGui.QVBoxLayout
的用法示例。
在下文中一共展示了QVBoxLayout.setMargin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import setMargin [as 别名]
def __init__(self, parent = None, logger = Logger()):
QWidgetWithLogger.__init__(self, parent, logger)
# start widget
vbox = QVBoxLayout()
vbox.setMargin(0)
vbox.setContentsMargins(0, 0, 0, 0)
# parameter action server topic selection
topic_widget = QTopicWidget(self, 'vigir_footstep_planning_msgs/GetParameterSetNamesAction', True)
vbox.addWidget(topic_widget)
# parameter set selection
self.parameter_set_selection_widget = QParameterSetSelectionWidget(self, logger)
self.parameter_set_selection_widget.param_cleared_signal.connect(self.param_cleared)
self.parameter_set_selection_widget.param_changed_signal.connect(self.param_changed)
topic_widget.topic_changed_signal.connect(self.topic_changed)
topic_widget.topic_changed_signal.connect(self.parameter_set_selection_widget.set_topic_name)
vbox.addWidget(self.parameter_set_selection_widget)
# end widget
self.setLayout(vbox)
# init widget
topic_widget.emit_topic_name()
示例2: __init__
# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import setMargin [as 别名]
def __init__(self, parent = None, logger = Logger(), step_plan_topic = str()):
QWidgetWithLogger.__init__(self, parent, logger)
# start widget
vbox = QVBoxLayout()
vbox.setMargin(0)
vbox.setContentsMargins(0, 0, 0, 0)
# step plan input topic selection
if len(step_plan_topic) == 0:
step_plan_topic_widget = QTopicWidget(topic_type = 'vigir_footstep_planning_msgs/StepPlan')
step_plan_topic_widget.topic_changed_signal.connect(self._init_step_plan_subscriber)
vbox.addWidget(step_plan_topic_widget)
else:
self._init_step_plan_subscriber(step_plan_topic)
# execute action server topic selection
execute_topic_widget = QTopicWidget(topic_type = 'vigir_footstep_planning_msgs/ExecuteStepPlanAction', is_action_topic = True)
execute_topic_widget.topic_changed_signal.connect(self._init_execute_action_client)
vbox.addWidget(execute_topic_widget)
# start button part
buttons_hbox = QHBoxLayout()
buttons_hbox.setMargin(0)
# execute
self.execute_command = QPushButton("Execute (Steps: 0)")
self.execute_command.clicked.connect(self.execute_command_callback)
self.execute_command.setEnabled(False)
buttons_hbox.addWidget(self.execute_command)
# repeat
self.repeat_command = QPushButton("Repeat")
self.repeat_command.clicked.connect(self.execute_command_callback)
self.repeat_command.setEnabled(False)
buttons_hbox.addWidget(self.repeat_command)
# stop
self.stop_command = QPushButton("Stop")
self.stop_command.clicked.connect(self.stop_command_callback)
self.stop_command.setEnabled(False)
buttons_hbox.addWidget(self.stop_command)
# end button part
vbox.addLayout(buttons_hbox)
# end widget
self.setLayout(vbox)
# init widget
if len(step_plan_topic) == 0:
step_plan_topic_widget.emit_topic_name()
execute_topic_widget.emit_topic_name()
示例3: __init__
# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import setMargin [as 别名]
def __init__(self, parent = None, subscribe = False):
QWidget.__init__(self, parent)
# start widget
vbox = QVBoxLayout()
vbox.setMargin(0)
vbox.setContentsMargins(0, 0, 0, 0)
# add error status text edit
self.error_status_text_box = QErrorStatusTextBox()
self.error_status_text_box_layout = QHBoxLayout()
self.error_status_text_box_layout.addWidget(self.error_status_text_box)
vbox.addLayout(self.error_status_text_box_layout)
# add panel
hbox = QHBoxLayout()
# clear push button
self.execute_command = QPushButton("Clear")
self.execute_command.clicked.connect(self.error_status_text_box.clear)
hbox.addWidget(self.execute_command)
hbox.addStretch()
# hide window checkbox
hide_window_check_box = QCheckBox("Hide")
hide_window_check_box.stateChanged.connect(self.state_changed)
hbox.addWidget(hide_window_check_box)
# end panel
vbox.addLayout(hbox)
# end widget
self.setLayout(vbox)
#self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
# subscriber
if (subscribe):
self.error_status_sub = rospy.Subscriber("error_status", ErrorStatus, self.error_status_callback)
self.subscribed = subscribe
# connect signal slot internally to prevent crash by subscriber
self.error_status_signal.connect(self.append_error_status)
示例4: __init__
# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import setMargin [as 别名]
def __init__(self, context, add_execute_widget = True):
super(StepInterfaceWidget, self).__init__()
# init signal mapper
self.command_mapper = QSignalMapper(self)
self.command_mapper.mapped.connect(self._publish_step_plan_request)
# start widget
widget = context
error_status_widget = QErrorStatusWidget()
self.logger = Logger(error_status_widget)
vbox = QVBoxLayout()
# start control box
controls_hbox = QHBoxLayout()
# left coloumn
left_controls_vbox = QVBoxLayout()
left_controls_vbox.setMargin(0)
self.add_command_button(left_controls_vbox, "Rotate Left", PatternParameters.ROTATE_LEFT)
self.add_command_button(left_controls_vbox, "Strafe Left", PatternParameters.STRAFE_LEFT)
self.add_command_button(left_controls_vbox, "Step Up", PatternParameters.STEP_UP)
self.add_command_button(left_controls_vbox, "Center on Left", PatternParameters.FEET_REALIGN_ON_LEFT)
left_controls_vbox.addStretch()
controls_hbox.addLayout(left_controls_vbox, 1)
# center coloumn
center_controls_vbox = QVBoxLayout()
center_controls_vbox.setMargin(0)
self.add_command_button(center_controls_vbox, "Forward", PatternParameters.FORWARD)
self.add_command_button(center_controls_vbox, "Backward", PatternParameters.BACKWARD)
self.add_command_button(center_controls_vbox, "Step Over", PatternParameters.STEP_OVER)
self.add_command_button(center_controls_vbox, "Center Feet", PatternParameters.FEET_REALIGN_ON_CENTER)
self.add_command_button(center_controls_vbox, "Wide Stance", PatternParameters.WIDE_STANCE)
center_controls_vbox.addStretch()
controls_hbox.addLayout(center_controls_vbox, 1)
# right coloumn
right_controls_vbox = QVBoxLayout()
right_controls_vbox.setMargin(0)
self.add_command_button(right_controls_vbox, "Rotate Right", PatternParameters.ROTATE_RIGHT)
self.add_command_button(right_controls_vbox, "Strafe Right", PatternParameters.STRAFE_RIGHT)
self.add_command_button(right_controls_vbox, "Step Down", PatternParameters.STEP_DOWN)
self.add_command_button(right_controls_vbox, "Center on Right", PatternParameters.FEET_REALIGN_ON_RIGHT)
right_controls_vbox.addStretch()
controls_hbox.addLayout(right_controls_vbox, 1)
# end control box
add_layout_with_frame(vbox, controls_hbox, "Commands:")
# start settings
settings_hbox = QHBoxLayout()
settings_hbox.setMargin(0)
# start left column
left_settings_vbox = QVBoxLayout()
left_settings_vbox.setMargin(0)
# frame id
self.frame_id_line_edit = QLineEdit("/world")
add_widget_with_frame(left_settings_vbox, self.frame_id_line_edit, "Frame ID:")
# do closing step
self.close_step_checkbox = QCheckBox()
self.close_step_checkbox.setText("Do closing step")
self.close_step_checkbox.setChecked(True)
left_settings_vbox.addWidget(self.close_step_checkbox)
# extra seperation
self.extra_seperation_checkbox = QCheckBox()
self.extra_seperation_checkbox.setText("Extra Seperation")
self.extra_seperation_checkbox.setChecked(False)
left_settings_vbox.addWidget(self.extra_seperation_checkbox)
left_settings_vbox.addStretch()
# number of steps
self.step_number = generate_q_double_spin_box(1, 1, 50, 0, 1.0)
add_widget_with_frame(left_settings_vbox, self.step_number, "Number Steps:")
# start step index
self.start_step_index = generate_q_double_spin_box(0, 0, 1000, 0, 1.0)
add_widget_with_frame(left_settings_vbox, self.start_step_index, "Start Step Index:")
# end left column
settings_hbox.addLayout(left_settings_vbox, 1)
# start center column
#.........这里部分代码省略.........