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


Python QMenu.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from python_qt_binding.QtGui import QMenu [as 别名]
# 或者: from python_qt_binding.QtGui.QMenu import __init__ [as 别名]
 def __init__(self, menu_button):
     QMenu.__init__(self)
     self.button = menu_button
     try:
         rqt_icon_path = roslib.packages.find_resource('rqt_gui', 'rqt.png').pop()
         menu_button.setText('')
         menu_button.setIcon(QIcon(rqt_icon_path))
         # creates a default config menu
         self.action_rqt_console = QAction(QIcon.fromTheme('mail-message-new'),
                                           "&Console", self,
                                           statusTip='"<p>Starts a python GUI plugin for displaying and filtering '
                                           'ROS log messages that is connected to the selected master.</p>"',
                                           triggered=self.on_show_console_clicked)
         self.addAction(self.action_rqt_console)
         self.action_rqt_logger_level = QAction(QIcon.fromTheme('format-indent-more'),
                                                "&Logger Level", self,
                                                statusTip='"<p>Starts a python GUI plugin for configuring the level of '
                                                'ROS loggers that is connected to the selected master.</p>"',
                                                triggered=self.on_show_logger_level_clicked)
         self.addAction(self.action_rqt_logger_level)
         self.action_rqt_tf_tree = QAction(QIcon.fromTheme('preferences-system-network'),
                                           "&TF Tree", self,
                                           statusTip='"<p>Starts a python GUI plugin for visualizing the TF tree'
                                           'that is connected to the selected master.</p>"',
                                           triggered=self.on_show_tf_tree_clicked)
         self.addAction(self.action_rqt_tf_tree)
         self.action_rqt_ros_graph = QAction(QIcon(":/icons/button_graph.png"),
                                             "Ros &Graph", self,
                                             statusTip='"<p>Starts a python GUI plugin for visualizing the ROS computation graph'
                                             'that is connected to the selected master</p>"',
                                             triggered=self.on_show_ros_graph_clicked)
         self.addAction(self.action_rqt_ros_graph)
         self.action_rosbag_record = QAction(QIcon.fromTheme('media-record'),
                                             "rosbag record", self,
                                             statusTip='"<p>Starts the rosbag record with selected topics</p>"',
                                             triggered=self.on_start_rosbag_clicked)
         self.addAction(self.action_rosbag_record)
         self.action_rqt_rviz = QAction(QIcon.fromTheme('image-x-generic'),
                                        "R&Viz", self,
                                        statusTip='"<p>Starts RViz</p>"',
                                        triggered=self.on_show_rviz_clicked)
         self.addAction(self.action_rqt_rviz)
         self.addSeparator()
         self.action_rqt = QAction(QIcon(rqt_icon_path),
                                   "&Rqt GUI", self,
                                   statusTip='"<p>Start the rqt GUI'
                                   'that is connected to the selected master</p>"',
                                   triggered=self.on_start_rqt_clicked)
         self.addAction(self.action_rqt)
         menu_button.setMenu(self)
     except Exception as e:
         print '%s' % e
         menu_button.setEnabled(False)
         menu_button.setToolTip('rqt_gui not found! Please install rqt to use its plugins!')
开发者ID:fkie,项目名称:multimaster_fkie,代码行数:56,代码来源:menu_rqt.py


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