当前位置: 首页>>代码示例>>Python>>正文


Python QMessageBox.warning方法代码示例

本文整理汇总了Python中python_qt_binding.QtGui.QMessageBox.warning方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.warning方法的具体用法?Python QMessageBox.warning怎么用?Python QMessageBox.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在python_qt_binding.QtGui.QMessageBox的用法示例。


在下文中一共展示了QMessageBox.warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_save_motion_button_clicked

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
 def on_save_motion_button_clicked(self):
     motion_name = str(self.motion_name_combo.currentText())
     if len(motion_name) == 0:
         QMessageBox.warning(self, 'Error', 'No name given to save this motion.')
         return
     self._motion_data.save(motion_name, self.get_motion_from_timeline())
     self.update_motion_name_combo()
开发者ID:tu-darmstadt-ros-pkg,项目名称:motion_editor,代码行数:9,代码来源:motion_editor_widget.py

示例2: on_delete_motion_button_clicked

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
 def on_delete_motion_button_clicked(self):
     motion_name = str(self.motion_name_combo.currentText())
     if len(motion_name) == 0:
         QMessageBox.warning(self, 'Error', 'No motion selected to delete.')
         return
     if motion_name not in self._motion_data:
         QMessageBox.warning(self, 'Error', 'Motion "%s" not in motion list.' % motion_name)
         return
     self._motion_data.delete(motion_name)
     self.update_motion_name_combo()
开发者ID:tu-darmstadt-ros-pkg,项目名称:motion_editor,代码行数:12,代码来源:motion_editor_widget.py

示例3: on_move_button_clicked

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
 def on_move_button_clicked(self):
     position_name = str(self.move_name_combo.currentText())
     if len(position_name) == 0:
         QMessageBox.warning(self, 'Error', 'No position selected to move to.')
         return
     appendix_name = str(self.move_appendix_combo.currentText())
     target_positions = self._position_data[self.robot_config.groups[appendix_name].group_type][position_name]
     target_positions = self.robot_config.groups[appendix_name].adapt_to_side(target_positions)
     print '[Motion Editor] Moving %s to "%s": %s' % (appendix_name, position_name, target_positions)
     self._motion_publisher.move_to_position(appendix_name, target_positions)
开发者ID:tu-darmstadt-ros-pkg,项目名称:motion_editor,代码行数:12,代码来源:position_editor_widget.py

示例4: on_run_motion_button_clicked

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
 def on_run_motion_button_clicked(self):
     motion_name = str(self.motion_name_combo.currentText())
     if len(motion_name) == 0:
         QMessageBox.warning(self, 'Error', 'No motion selected to run.')
         return
     if motion_name not in self._motion_data:
         QMessageBox.warning(self, 'Error', 'Motion "%s" not in motion list.' % motion_name)
         return
     self._clear_playback_marker()
     self._motion_publisher.publish_motion(self._motion_data[motion_name], self.time_factor_spin.value())
     print '[Motion Editor] Running motion:', motion_name
开发者ID:tu-darmstadt-ros-pkg,项目名称:motion_editor,代码行数:13,代码来源:motion_editor_widget.py

示例5: _send_comand_cb

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
	def _send_comand_cb(self):
		'''
			Sends a mission command
		'''
		msg = MissionCommand()	
		msg.command = self._widget.comboBox_command.currentText()
		
		try:
			msg.variable = float(self._widget.lineEdit_parameter.text().encode("utf8"))
		except ValueError, e:
			rospy.logerr('MissionCommanderGUI:_send_command_cb: %s',e)
			QMessageBox.warning(self._widget, 'Error', 'Incorrect format of the parameter. A number is expected')
开发者ID:RobospectEU,项目名称:robospect_mission_planner,代码行数:14,代码来源:rqt_mission_commander.py

示例6: on_delete_button_clicked

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
 def on_delete_button_clicked(self):
     appendix_name = str(self.save_appendix_combo.currentText())
     position_name = str(self.save_name_combo.currentText())
     if len(position_name) == 0 or \
        position_name not in self._position_data[self.robot_config.groups[appendix_name].group_type]:
         QMessageBox.warning(self, 'Error', 'Position "%s" not in position list.')
         return
     self._position_data[self.robot_config.groups[appendix_name].group_type].delete(position_name)
     self.position_list_updated.emit(self._position_data)
     self.on_save_appendix_combo_currentIndexChanged(appendix_name)
     if self.robot_config.groups[self.move_appendix_combo.currentText()].group_type \
        == self.robot_config.groups[appendix_name].group_type:
         self.on_move_appendix_combo_currentIndexChanged(appendix_name)
开发者ID:tu-darmstadt-ros-pkg,项目名称:motion_editor,代码行数:15,代码来源:position_editor_widget.py

示例7: on_load_motion_button_clicked

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
 def on_load_motion_button_clicked(self):
     motion_name = str(self.motion_name_combo.currentText())
     if len(motion_name) == 0:
         QMessageBox.warning(self, 'Error', 'No motion selected to load.')
         return
     if motion_name not in self._motion_data:
         QMessageBox.warning(self, 'Error', 'Motion "%s" not in motion list.' % motion_name)
         return
     self.on_clear_motion_button_clicked()
     motion = self._motion_data[motion_name]
     for group_name, poses in motion.items():
         for pose in poses:
             data = self.robot_config.groups[group_name].adapt_to_side(pose['positions'])
             self._timeline_widget.scene().add_clip(group_name, pose['name'], pose['starttime'], pose['duration'], data)
开发者ID:tu-darmstadt-ros-pkg,项目名称:motion_editor,代码行数:16,代码来源:motion_editor_widget.py

示例8: on_save_button_clicked

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
 def on_save_button_clicked(self):
     position_name = str(self.save_name_combo.currentText())
     if len(position_name) == 0:
         QMessageBox.warning(self, 'Error', 'No name given to save this position.')
         return
     appendix_name = str(self.save_appendix_combo.currentText())
     group = self.robot_config.groups[appendix_name]
     current_positions = self._motion_publisher.get_current_positions(group)
     current_positions = self.robot_config.groups[appendix_name].adapt_to_side(current_positions)
     print '[Motion Editor] Saving %s as "%s": %s' % (appendix_name, position_name, current_positions)
     self._position_data[self.robot_config.groups[appendix_name].group_type].save(position_name, current_positions)
     self.position_list_updated.emit(self._position_data)
     self.on_save_appendix_combo_currentIndexChanged(appendix_name)
     if self.robot_config.groups[self.move_appendix_combo.currentText()].group_type \
        == self.robot_config.groups[appendix_name].group_type:
         self.on_move_appendix_combo_currentIndexChanged(appendix_name)
开发者ID:tu-darmstadt-ros-pkg,项目名称:motion_editor,代码行数:18,代码来源:position_editor_widget.py

示例9: _reset_steering_encoder_cb

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
	def _reset_steering_encoder_cb(self):
		'''
			Resets the steering encoder
		'''
		msg = Empty()
		ret = QMessageBox.question(self._widget, "Reset Encoder", 'Are you sure of resetting the encoder?', QMessageBox.Ok, QMessageBox.Cancel)
		
		if ret == QMessageBox.Ok:
			try:
				self._reset_steering_encoder_service_client()
			except rospy.ROSInterruptException,e: 
				rospy.logerr('MissionCommanderGUI:_reset_steering_encoder_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
			except rospy.ServiceException,e: 
				rospy.logerr('MissionCommanderGUI:_reset_steering_encoder_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
开发者ID:RobospectEU,项目名称:robospect_mission_planner,代码行数:18,代码来源:rqt_mission_commander.py

示例10: _rightclick_menu

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
    def _rightclick_menu(self, event):
        """
        :type event: QEvent
        """

        # QTreeview.selectedIndexes() returns 0 when no node is selected.
        # This can happen when after booting no left-click has been made yet
        # (ie. looks like right-click doesn't count). These lines are the
        # workaround for that problem.
        selected = self._messages_tree.selectedIndexes()
        if len(selected) == 0:
            return

        menu = QMenu()
        text_action = QAction(self.tr('View Text'), menu)
        menu.addAction(text_action)
        raw_action = QAction(self.tr('View Raw'), menu)
        menu.addAction(raw_action)

        action = menu.exec_(event.globalPos())

        if action == raw_action or action == text_action:
            rospy.logdebug('_rightclick_menu selected={}'.format(selected))
            selected_type = selected[1].data()

            if selected_type[-2:] == '[]':
                selected_type = selected_type[:-2]
            browsetext = None
            try:
                if (self._mode == rosmsg.MODE_MSG or
                    self._mode == rosaction.MODE_ACTION):
                    browsetext = rosmsg.get_msg_text(selected_type,
                                                     action == raw_action)
                elif self._mode == rosmsg.MODE_SRV:
                    browsetext = rosmsg.get_srv_text(selected_type,
                                                     action == raw_action)

                else:
                    raise
            except rosmsg.ROSMsgException, e:
                QMessageBox.warning(self, self.tr('Warning'),
                                    self.tr('The selected item component ' +
                                            'does not have text to view.'))
            if browsetext is not None:
                self._browsers.append(TextBrowseDialog(browsetext,
                                                       self._rospack))
                self._browsers[-1].show()
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:49,代码来源:messages_widget.py

示例11: _set_pantilt_cb

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
	def _set_pantilt_cb(self):
		'''
			Sends the setPanTilt command to the platform
		'''
		msg = PlatformCommand()	
		msg.command = 'setPanTilt'
		
		msg.variables = [self._widget.doubleSpinBox_set_pan.value(), self._widget.doubleSpinBox_set_tilt.value()]
		#msg.variables = [0.0, 0.0]
		
		#print self._widget.doubleSpinBox_set_pan.value()
		
		try:
			self._platform_command_service_client(msg)
		except rospy.ROSInterruptException,e: 
			rospy.logerr('MissionCommanderGUI:_set_pantilt_cb: %s',e)
			QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
开发者ID:RobospectEU,项目名称:robospect_mission_planner,代码行数:19,代码来源:rqt_mission_commander.py

示例12: _initialize_platform_cb

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
	def _initialize_platform_cb(self):
		'''
			Initialize platform encoders
		'''
		msg = Empty()
		
		
		ret = QMessageBox.question(self._widget, "Init platform", 'Are you sure of initializing?', QMessageBox.Ok, QMessageBox.Cancel)
		
		if ret == QMessageBox.Ok:
			try:
				self._initialize_platform_service_client()
			except rospy.ROSInterruptException,e: 
				rospy.logerr('MissionCommanderGUI:_initialize_platform_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
			except rospy.ServiceException,e: 
				rospy.logerr('MissionCommanderGUI:_initialize_platform_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
开发者ID:RobospectEU,项目名称:robospect_mission_planner,代码行数:20,代码来源:rqt_mission_commander.py

示例13: _stop_vehicle_cb

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
	def _stop_vehicle_cb(self):
		'''
			Sends the stopcommand to the platform
		'''
		msg = PlatformCommand()	
		msg.command = 'cancel'
		
		ret = QMessageBox.question(self._widget, "Stop Vehicle", 'Do you want to stop the vehicle?', QMessageBox.Ok, QMessageBox.Cancel)
		
		if ret == QMessageBox.Ok:
			try:
				self._platform_command_service_client(msg)
			except rospy.ROSInterruptException,e: 
				rospy.logerr('MissionCommanderGUI:_stop_vehicle_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
			except rospy.ServiceException,e: 
				rospy.logerr('MissionCommanderGUI:_stop_vehicle_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
开发者ID:RobospectEU,项目名称:robospect_mission_planner,代码行数:20,代码来源:rqt_mission_commander.py

示例14: _fold_crane_cb

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
	def _fold_crane_cb(self):
		'''
			Sends the foldCrane command to the platform
		'''
		msg = PlatformCommand()	
		msg.command = 'foldCrane'
		
		ret = QMessageBox.question(self._widget, "Fold Crane", 'Do you want to fold the crane?', QMessageBox.Ok, QMessageBox.Cancel)
		
		if ret == QMessageBox.Ok:
			try:
				self._platform_command_service_client(msg)
			except rospy.ROSInterruptException,e: 
				rospy.logerr('MissionCommanderGUI:_fold_crane_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
			except rospy.ServiceException,e: 
				rospy.logerr('MissionCommanderGUI:_fold_crane_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
开发者ID:RobospectEU,项目名称:robospect_mission_planner,代码行数:20,代码来源:rqt_mission_commander.py

示例15: _set_control_mode_cb

# 需要导入模块: from python_qt_binding.QtGui import QMessageBox [as 别名]
# 或者: from python_qt_binding.QtGui.QMessageBox import warning [as 别名]
	def _set_control_mode_cb(self):
		'''
			Sets the platform control mode
		'''
		msg = SetControlMode()	
		msg.mode = self._widget.comboBox_control_mode.currentText()
		
		ret = QMessageBox.question(self._widget, "Set Control Mode", 'Set control mode to %s?'%msg.mode, QMessageBox.Ok, QMessageBox.Cancel)
		
		if ret == QMessageBox.Ok:
		
			try:
				self._set_control_mode_service_client(msg.mode) 
			except rospy.ROSInterruptException,e: 
				rospy.logerr('MissionCommanderGUI:_set_control_mode_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
			except rospy.ServiceException,e: 
				rospy.logerr('MissionCommanderGUI:_set_control_mode_cb: %s',e)
				QMessageBox.warning(self._widget, 'Error', 'Error sending the command')
开发者ID:RobospectEU,项目名称:robospect_mission_planner,代码行数:21,代码来源:rqt_mission_commander.py


注:本文中的python_qt_binding.QtGui.QMessageBox.warning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。