本文整理汇总了Python中PyQt4.QtGui.QErrorMessage.setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:Python QErrorMessage.setWindowTitle方法的具体用法?Python QErrorMessage.setWindowTitle怎么用?Python QErrorMessage.setWindowTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QErrorMessage
的用法示例。
在下文中一共展示了QErrorMessage.setWindowTitle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: input_device_changed
# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import setWindowTitle [as 别名]
def input_device_changed(self, index):
success, index = self.audio_device.select_input_device(index)
self.ui.DeviceList.setCurrentIndex(index)
self.fft_plot.must_plot = True
if not success:
# Note: the error message is a child of the settings dialog, so that
# that dialog remains on top when the error message is closed
error_message = QErrorMessage(self.settings_dialog)
error_message.setWindowTitle("Input device error")
error_message.showMessage("Impossible to use the selected input"
" device, reverting to the previous one")
示例2: second_channel_changed
# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import setWindowTitle [as 别名]
def second_channel_changed(self, index):
self.ui.actionStart.setChecked(False)
success, index = self.audiobackend.select_second_channel(index)
self.settings_dialog.comboBox_secondChannel.setCurrentIndex(index)
if not success:
# Note: the error message is a child of the settings dialog, so that
# that dialog remains on top when the error message is closed
error_message = QErrorMessage(self.settings_dialog)
error_message.setWindowTitle("Input device error")
error_message.showMessage("Impossible to use the selected channel as the second channel, reverting to the previous one")
self.ui.actionStart.setChecked(True)
示例3: Stepper
# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import setWindowTitle [as 别名]
class Stepper(PluginBase, Ui_Stepper):
qtcb_position_reached = pyqtSignal(int)
qtcb_under_voltage = pyqtSignal(int)
def __init__(self, ipcon, uid, version):
PluginBase.__init__(self, ipcon, uid, 'Stepper Brick', version)
self.setupUi(self)
self.stepper = BrickStepper(uid, ipcon)
self.device = self.stepper
self.endis_all(False)
self.update_timer = QTimer()
self.update_timer.timeout.connect(self.update_data)
self.speedometer = SpeedoMeter()
self.vertical_layout_right.insertWidget(5, self.speedometer)
self.new_value = 0
self.update_counter = 0
self.full_brake_time = 0
self.qem = QErrorMessage(self)
self.qem.setWindowTitle("Under Voltage")
self.velocity_slider.sliderReleased.connect(self.velocity_slider_released)
self.velocity_slider.valueChanged.connect(self.velocity_spin.setValue)
self.velocity_spin.editingFinished.connect(self.velocity_spin_finished)
self.acceleration_slider.sliderReleased.connect(self.acceleration_slider_released)
self.acceleration_slider.valueChanged.connect(self.acceleration_spin.setValue)
self.acceleration_spin.editingFinished.connect(self.acceleration_spin_finished)
self.deceleration_slider.sliderReleased.connect(self.deceleration_slider_released)
self.deceleration_slider.valueChanged.connect(self.deceleration_spin.setValue)
self.deceleration_spin.editingFinished.connect(self.deceleration_spin_finished)
# self.decay_slider.sliderReleased.connect(self.decay_slider_released)
# self.decay_slider.valueChanged.connect(self.decay_spin.setValue)
# self.decay_spin.editingFinished.connect(self.decay_spin_finished)
self.enable_checkbox.stateChanged.connect(self.enable_state_changed)
self.forward_button.pressed.connect(self.forward_pressed)
self.stop_button.pressed.connect(self.stop_pressed)
self.full_brake_button.pressed.connect(self.full_brake_pressed)
self.backward_button.pressed.connect(self.backward_pressed)
self.to_button.pressed.connect(self.to_button_pressed)
self.steps_button.pressed.connect(self.steps_button_pressed)
self.motor_current_button.pressed.connect(self.motor_current_button_pressed)
self.minimum_motor_voltage_button.pressed.connect(self.minimum_motor_voltage_button_pressed)
self.mode_dropbox.currentIndexChanged.connect(self.mode_changed)
self.qtcb_position_reached.connect(self.cb_position_reached)
self.stepper.register_callback(self.stepper.CALLBACK_POSITION_REACHED,
self.qtcb_position_reached.emit)
self.qtcb_under_voltage.connect(self.cb_under_voltage)
self.stepper.register_callback(self.stepper.CALLBACK_UNDER_VOLTAGE,
self.qtcb_under_voltage.emit)
self.update_data_async_thread = None
self.ste = 0
self.pos = 0
self.current_velocity = 0
self.cur = 0
self.sv = 0
self.ev = 0
self.mv = 0
self.mod = 0
def start(self):
self.update_timer.start(100)
self.update_start()
def stop(self):
self.update_timer.stop()
def has_reset_device(self):
return self.version >= (1, 1, 4)
def reset_device(self):
if self.has_reset_device():
self.stepper.reset()
def is_brick(self):
return True
def get_url_part(self):
return 'stepper'
@staticmethod
def has_device_identifier(device_identifier):
return device_identifier == BrickStepper.DEVICE_IDENTIFIER
def cb_position_reached(self, position):
#.........这里部分代码省略.........
示例4: Blinkenlights
# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import setWindowTitle [as 别名]
class Blinkenlights(QApplication):
HOST = "localhost"
PORT = 4223
ipcon = None
projects = []
active_project = None
error_msg = None
def __init__(self, args):
super(QApplication, self).__init__(args)
self.error_msg = QErrorMessage()
self.error_msg.setWindowTitle("Starter Kit: Blinkenlights Demo " + config.DEMO_VERSION)
signal.signal(signal.SIGINT, self.exit_demo)
signal.signal(signal.SIGTERM, self.exit_demo)
self.make_gui()
self.connect()
def exit_demo(self, signl=None, frme=None):
try:
self.ipcon.disconnect()
self.timer.stop()
self.tabs.destroy()
except:
pass
sys.exit()
def make_gui(self):
self.main = MainWindow(self)
self.main.setWindowIcon(QIcon(os.path.join(ProgramPath.program_path(), "demo-icon.png")))
self.tabs = QTabWidget()
widget = QWidget()
layout = QVBoxLayout()
layout.addWidget(self.tabs)
widget.setLayout(layout)
self.main.setCentralWidget(widget)
self.setup = SetupWidget(self.tabs, self)
self.tetris = TetrisWidget(self.tabs, self)
self.pong = PongWidget(self.tabs, self)
self.fire = FireWidget(self.tabs, self)
self.text = TextWidget(self.tabs, self)
self.images = ImagesWidget(self.tabs, self)
self.rainbow = RainbowWidget(self.tabs, self)
self.projects.append(self.setup)
self.projects.append(self.tetris)
self.projects.append(self.pong)
self.projects.append(self.fire)
self.projects.append(self.text)
self.projects.append(self.images)
self.projects.append(self.rainbow)
self.tabs.addTab(self.setup, "Setup")
self.tabs.addTab(self.tetris, "Tetris")
self.tabs.addTab(self.pong, "Pong")
self.tabs.addTab(self.fire, "Fire")
self.tabs.addTab(self.text, "Text")
self.tabs.addTab(self.images, "Images")
self.tabs.addTab(self.rainbow, "Rainbow")
self.active_project = self.projects[0]
self.tabs.currentChanged.connect(self.tab_changed_slot)
self.main.setWindowTitle("Starter Kit: Blinkenlights Demo " + config.DEMO_VERSION)
self.main.show()
def connect(self):
config.UID_LED_STRIP_BRICKLET = None
self.setup.label_led_strip_found.setText('No')
self.setup.label_led_strip_uid.setText('None')
config.UID_MULTI_TOUCH_BRICKLET = None
self.setup.label_multi_touch_found.setText('No')
self.setup.label_multi_touch_uid.setText('None')
config.UID_DUAL_BUTTON_BRICKLET = (None, None)
self.setup.label_dual_button1_found.setText('No')
self.setup.label_dual_button1_uid.setText('None')
self.setup.label_dual_button2_found.setText('No')
self.setup.label_dual_button2_uid.setText('None')
config.UID_PIEZO_SPEAKER_BRICKLET = None
self.setup.label_piezo_speaker_found.setText('No')
self.setup.label_piezo_speaker_uid.setText('None')
config.UID_SEGMENT_DISPLAY_4X7_BRICKLET = None
self.setup.label_segment_display_found.setText('No')
self.setup.label_segment_display_uid.setText('None')
#.........这里部分代码省略.........
示例5: Servo
# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import setWindowTitle [as 别名]
class Servo(PluginBase, Ui_Servo):
qtcb_under_voltage = pyqtSignal(int)
def __init__ (self, ipcon, uid):
PluginBase.__init__(self, ipcon, uid)
self.setupUi(self)
self.servo = brick_servo.Servo(self.uid)
self.device = self.servo
self.ipcon.add_device(self.servo)
self.version = '.'.join(map(str, self.servo.get_version()[1]))
self.update_timer = QTimer()
self.update_timer.timeout.connect(self.update_apply)
self.update_timer.setInterval(0)
self.update_timer.setSingleShot(True)
layout = QVBoxLayout(self)
layout.addWidget(QLabel('Servo'))
self.position_list = []
self.velocity_list = []
self.acceleration_list = []
self.enable_list = []
self.up_ena = [0]*7
self.up_pos = [0]*7
self.up_vel = [0]*7
self.up_acc = [0]*7
self.alive = True
for i in range(1, 8):
label = QLabel()
label.setText('Off')
self.enable_list.append(label)
self.status_grid.addWidget(label, i, 1)
for i in range(1, 8):
pk = PositionKnob()
self.position_list.append(pk)
self.status_grid.addWidget(pk, i, 2)
for i in range(1, 8):
cb = ColorBar(Qt.Vertical)
self.velocity_list.append(cb)
self.status_grid.addWidget(cb, i, 3)
for i in range(1, 8):
cb = ColorBar(Qt.Vertical)
self.acceleration_list.append(cb)
self.status_grid.addWidget(cb, i, 4)
self.qem = QErrorMessage(self)
self.qem.setWindowTitle("Under Voltage")
self.test_button.clicked.connect(self.test_button_clicked)
self.output_voltage_button.clicked.connect(self.output_voltage_button_clicked)
self.servo_dropbox.currentIndexChanged.connect(lambda x: self.update_servo_specific())
self.enable_checkbox.stateChanged.connect(self.enable_state_changed)
self.position_slider.sliderReleased.connect(self.position_slider_released)
self.position_slider.valueChanged.connect(self.position_spin.setValue)
self.position_spin.editingFinished.connect(self.position_spin_finished)
self.velocity_slider.sliderReleased.connect(self.velocity_slider_released)
self.velocity_slider.valueChanged.connect(self.velocity_spin.setValue)
self.velocity_spin.editingFinished.connect(self.velocity_spin_finished)
self.acceleration_slider.sliderReleased.connect(self.acceleration_slider_released)
self.acceleration_slider.valueChanged.connect(self.acceleration_spin.setValue)
self.acceleration_spin.editingFinished.connect(self.acceleration_spin_finished)
self.period_slider.sliderReleased.connect(self.period_slider_released)
self.period_slider.valueChanged.connect(self.period_spin.setValue)
self.period_spin.editingFinished.connect(self.period_spin_finished)
self.pulse_width_min_spin.editingFinished.connect(self.pulse_width_spin_finished)
self.pulse_width_max_spin.editingFinished.connect(self.pulse_width_spin_finished)
self.degree_min_spin.editingFinished.connect(self.degree_spin_finished)
self.degree_max_spin.editingFinished.connect(self.degree_spin_finished)
self.minimum_voltage_button.pressed.connect(self.minimum_voltage_button_pressed)
self.qtcb_under_voltage.connect(self.cb_under_voltage)
self.servo.register_callback(self.servo.CALLBACK_UNDER_VOLTAGE,
self.qtcb_under_voltage.emit)
class WorkerThread(QThread):
def __init__(self, parent = None, func = None):
QThread.__init__(self, parent)
self.func = func
def run(self):
self.func()
self.test_event = Event()
self.test_thread_object = WorkerThread(self, self.test_thread)
self.update_event = Event()
#.........这里部分代码省略.........
示例6: DC
# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import setWindowTitle [as 别名]
#.........这里部分代码省略.........
# else:
# self.enable_encoder_checkbox.setText('Enable Encoder (Firmware >= 2.01 required)')
# self.enable_encoder_checkbox.setEnabled(False)
def start(self):
self.update_timer.start(1000)
async_call(self.dc.set_current_velocity_period, 100, None, self.increase_error_count)
self.update_start()
self.update_data()
def stop(self):
self.update_timer.stop()
async_call(self.dc.set_current_velocity_period, 0, None, self.increase_error_count)
def has_reset_device(self):
return self.version >= (1, 1, 3)
def reset_device(self):
if self.has_reset_device():
self.dc.reset()
def is_brick(self):
return True
def get_url_part(self):
return 'dc'
@staticmethod
def has_device_identifier(device_identifier):
return device_identifier == BrickDC.DEVICE_IDENTIFIER
def cb_emergency_shutdown(self):
if not self.qem.isVisible():
self.qem.setWindowTitle("Emergency Shutdown")
self.qem.showMessage("Emergency Shutdown: Short-Circuit or Over-Temperature")
def cb_under_voltage(self, ov):
mv_str = self.minimum_voltage_label.text()
ov_str = "%gV" % round(ov/1000.0, 1)
if not self.qem.isVisible():
self.qem.setWindowTitle("Under Voltage")
self.qem.showMessage("Under Voltage: Output Voltage of " + ov_str +
" is below minimum voltage of " + mv_str,
"DC_UnderVoltage")
def encoder_hide_all(self):
self.enable_encoder_checkbox.hide()
self.encoder_hide()
def encoder_hide(self):
self.p_label.hide()
self.p_spinbox.hide()
self.i_label.hide()
self.i_spinbox.hide()
self.d_label.hide()
self.d_spinbox.hide()
self.st_label.hide()
self.st_spinbox.hide()
self.cpr_label.hide()
self.cpr_spinbox.hide()
self.encoder_spacer.hide()
def encoder_show(self):
self.p_label.show()
self.p_spinbox.show()
self.i_label.show()
示例7: DC
# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import setWindowTitle [as 别名]
class DC(PluginBase, Ui_DC):
qtcb_position_reached = pyqtSignal(int)
qtcb_under_voltage = pyqtSignal(int)
qtcb_emergency_shutdown = pyqtSignal()
def __init__ (self, ipcon, uid):
PluginBase.__init__(self, ipcon, uid)
self.setupUi(self)
self.dc = brick_dc.DC(self.uid)
self.device = self.dc
self.ipcon.add_device(self.dc)
self.version = '.'.join(map(str, self.dc.get_version()[1]))
self.update_timer = QTimer()
self.update_timer.timeout.connect(self.update_data)
self.speedometer = SpeedoMeter()
self.vertical_layout_right.insertWidget(4, self.speedometer)
self.new_value = 0
self.update_counter = 0
self.full_brake_time = 0
self.velocity_slider.sliderReleased.connect(self.velocity_slider_released)
self.velocity_slider.valueChanged.connect(self.velocity_spin.setValue)
self.velocity_spin.editingFinished.connect(self.velocity_spin_finished)
self.acceleration_slider.sliderReleased.connect(self.acceleration_slider_released)
self.acceleration_slider.valueChanged.connect(self.acceleration_spin.setValue)
self.acceleration_spin.editingFinished.connect(self.acceleration_spin_finished)
self.frequency_slider.sliderReleased.connect(self.frequency_slider_released)
self.frequency_slider.valueChanged.connect(self.frequency_spin.setValue)
self.frequency_spin.editingFinished.connect(self.frequency_spin_finished)
self.radio_mode_brake.toggled.connect(self.brake_value_changed)
self.radio_mode_coast.toggled.connect(self.coast_value_changed)
self.minimum_voltage_button.pressed.connect(self.minimum_voltage_button_pressed)
self.full_brake_button.pressed.connect(self.full_brake_pressed)
self.enable_checkbox.stateChanged.connect(self.enable_state_changed)
self.emergency_signal = None
self.under_signal = None
self.current_velocity_signal = None
self.velocity_reached_signal = None
self.qem = QErrorMessage(self)
self.qtcb_under_voltage.connect(self.cb_under_voltage)
self.dc.register_callback(self.dc.CALLBACK_UNDER_VOLTAGE,
self.qtcb_under_voltage.emit)
self.qtcb_emergency_shutdown.connect(self.cb_emergency_shutdown)
self.dc.register_callback(self.dc.CALLBACK_EMERGENCY_SHUTDOWN,
self.qtcb_emergency_shutdown.emit)
self.qtcb_position_reached.connect(self.update_velocity)
self.dc.register_callback(self.dc.CALLBACK_VELOCITY_REACHED,
self.qtcb_position_reached.emit)
self.dc.register_callback(self.dc.CALLBACK_CURRENT_VELOCITY,
self.qtcb_position_reached.emit)
def start(self):
self.update_timer.start(1000)
try:
self.dc.set_current_velocity_period(100)
self.update_start()
self.update_data()
except ip_connection.Error:
return
def stop(self):
self.update_timer.stop()
try:
self.dc.set_current_velocity_period(0)
except ip_connection.Error:
return
@staticmethod
def has_name(name):
return 'DC Brick' in name
def cb_emergency_shutdown(self):
if not self.qem.isVisible():
self.qem.setWindowTitle("Emergency Shutdown")
self.qem.showMessage("Emergency Shutdown: Short-Circuit or Over-Temperature")
def cb_under_voltage(self, ov):
mv_str = self.minimum_voltage_label.text()
ov_str = "%gV" % round(ov/1000.0, 1)
if not self.qem.isVisible():
self.qem.setWindowTitle("Under Voltage")
self.qem.showMessage("Under Voltage: Output Voltage of " + ov_str +
" is below minimum voltage of " + mv_str)
#.........这里部分代码省略.........
示例8: Stepper
# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import setWindowTitle [as 别名]
class Stepper(PluginBase, Ui_Stepper):
qtcb_position_reached = pyqtSignal(int)
qtcb_under_voltage = pyqtSignal(int)
def __init__(self, *args):
PluginBase.__init__(self, BrickStepper, *args)
self.setupUi(self)
self.stepper = self.device
self.endis_all(False)
self.update_timer = QTimer()
self.update_timer.timeout.connect(self.update_data)
self.new_value = 0
self.update_counter = 0
self.full_brake_time = 0
self.qem = QErrorMessage(self)
self.qem.setWindowTitle("Under Voltage")
self.decay_widget.hide()
self.setting_sync_rect_checkbox = False
self.velocity_syncer = SliderSpinSyncer(self.velocity_slider,
self.velocity_spin,
self.velocity_changed)
self.acceleration_syncer = SliderSpinSyncer(self.acceleration_slider,
self.acceleration_spin,
self.acceleration_changed)
self.deceleration_syncer = SliderSpinSyncer(self.deceleration_slider,
self.deceleration_spin,
self.deceleration_changed)
self.decay_syncer = SliderSpinSyncer(self.decay_slider,
self.decay_spin,
self.decay_changed)
self.enable_checkbox.toggled.connect(self.enable_toggled)
self.forward_button.clicked.connect(self.forward_clicked)
self.stop_button.clicked.connect(self.stop_clicked)
self.full_brake_button.clicked.connect(self.full_brake_clicked)
self.backward_button.clicked.connect(self.backward_clicked)
self.to_button.clicked.connect(self.to_button_clicked)
self.steps_button.clicked.connect(self.steps_button_clicked)
self.motor_current_button.clicked.connect(self.motor_current_button_clicked)
self.minimum_motor_voltage_button.clicked.connect(self.minimum_motor_voltage_button_clicked)
self.sync_rect_checkbox.toggled.connect(self.sync_rect_toggled)
self.mode_dropbox.currentIndexChanged.connect(self.mode_changed)
self.qtcb_position_reached.connect(self.cb_position_reached)
self.stepper.register_callback(self.stepper.CALLBACK_POSITION_REACHED,
self.qtcb_position_reached.emit)
self.qtcb_under_voltage.connect(self.cb_under_voltage)
self.stepper.register_callback(self.stepper.CALLBACK_UNDER_VOLTAGE,
self.qtcb_under_voltage.emit)
self.ste = 0
self.pos = 0
self.current_velocity = 0
self.cur = 0
self.sv = 0
self.ev = 0
self.mv = 0
self.mod = 0
if self.firmware_version >= (1, 1, 4):
reset = QAction('Reset', self)
reset.triggered.connect(lambda: self.stepper.reset())
self.set_actions(reset)
def start(self):
self.update_timer.start(100)
self.update_start()
def stop(self):
self.update_timer.stop()
def destroy(self):
pass
def get_url_part(self):
return 'stepper'
@staticmethod
def has_device_identifier(device_identifier):
return device_identifier == BrickStepper.DEVICE_IDENTIFIER
def cb_position_reached(self, position):
self.position_update(position)
self.endis_all(True)
#.........这里部分代码省略.........