本文整理汇总了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!')