本文整理汇总了Python中PySide.QtGui.QSlider.setFocusPolicy方法的典型用法代码示例。如果您正苦于以下问题:Python QSlider.setFocusPolicy方法的具体用法?Python QSlider.setFocusPolicy怎么用?Python QSlider.setFocusPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QSlider
的用法示例。
在下文中一共展示了QSlider.setFocusPolicy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EegCarDashboardWindow
# 需要导入模块: from PySide.QtGui import QSlider [as 别名]
# 或者: from PySide.QtGui.QSlider import setFocusPolicy [as 别名]
#.........这里部分代码省略.........
self.dashboard.set_max_throttle(DEFAULT_MAX_THROTTLE)
self.dashboard.set_backward_max_throttle(DEFAULT_MAX_BACK_THROTTLE)
self.layout = QVBoxLayout(self)
# Drive Setting
self.rc_mode = QCheckBox('Remote Control', self)
self.rc_mode.stateChanged.connect(self.remote_control)
self.rc_stright_mode = QCheckBox('RC Stright', self)
self.rc_stright_mode.stateChanged.connect(self.stright_control)
self.keep_mode_checkbox = QCheckBox('Keep Mode', self)
self.keep_mode_checkbox.stateChanged.connect(self.keep_mode_control)
self.power_handle_mode_checkbox = QCheckBox('Power Handle', self)
self.power_handle_mode_checkbox.stateChanged.connect(self.power_handle_mode_control)
self.ignore_eeg_input = QCheckBox('Ignore Eeg Input', self)
self.ignore_eeg_input.stateChanged.connect(self.ignore_eeg_input_control)
drive_layout = QHBoxLayout(self)
drive_layout.addWidget(self.rc_mode)
drive_layout.addWidget(self.rc_stright_mode)
drive_layout.addWidget(self.keep_mode_checkbox)
drive_layout.addWidget(self.power_handle_mode_checkbox)
drive_layout.addWidget(self.ignore_eeg_input)
drive_groupbox = QtGui.QGroupBox("Drive Status & Setting")
drive_groupbox.setLayout(drive_layout)
# Throttle Setting
self.throttle_slider = QSlider(Qt.Horizontal)
self.throttle_slider.setFocusPolicy(Qt.StrongFocus)
self.throttle_slider.setTickPosition(QSlider.TicksBothSides)
self.throttle_slider.setTickInterval(10)
self.throttle_slider.setSingleStep(10)
self.throttle_slider.setValue(DEFAULT_MAX_THROTTLE)
self.throttle_slider.valueChanged.connect(self.throttle_slider.setValue)
self.connect(self.throttle_slider, SIGNAL("valueChanged(int)"), self.setSliderMaxThrottle)
self.throttle_label = QLabel('Max Throttle (%): ', self)
self.maxThrottle = QLineEdit(str(DEFAULT_MAX_THROTTLE))
# self.maxThrottle.textChanged[str].connect(self.setMaxThrottle)
self.maxThrottle.editingFinished.connect(self.setMaxThrottle)
self.maxThrottle.setMaxLength(2)
self.maxThrottle.setMaximumWidth(40)
self.backwardMaxThrottle = QLineEdit(str(DEFAULT_MAX_BACK_THROTTLE))
# self.maxThrottle.textChanged[str].connect(self.setMaxThrottle)
self.backwardMaxThrottle.editingFinished.connect(self.setBackwardMaxThrottle)
self.backwardMaxThrottle.setMaxLength(2)
self.backwardMaxThrottle.setMaximumWidth(40)
throttle_layout = QHBoxLayout(self)
throttle_layout.addWidget(self.throttle_label)
throttle_layout.addWidget(self.throttle_slider)
throttle_layout.addWidget(QLabel("Forward Max:"))
throttle_layout.addWidget(self.maxThrottle)
throttle_layout.addWidget(QLabel("Backward Max:"))
throttle_layout.addWidget(self.backwardMaxThrottle)
throttle_groupbox = QtGui.QGroupBox("Max Throttle Setting (30-99)")