本文整理汇总了Python中python_qt_binding.QtGui.QIcon类的典型用法代码示例。如果您正苦于以下问题:Python QIcon类的具体用法?Python QIcon怎么用?Python QIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QIcon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, topics):
super(HistogramPlotWidget, self).__init__()
self.setObjectName('HistogramPlotWidget')
rp = rospkg.RosPack()
ui_file = os.path.join(rp.get_path('jsk_rqt_plugins'),
'resource', 'plot_histogram.ui')
loadUi(ui_file, self)
self.cv_bridge = CvBridge()
self.subscribe_topic_button.setIcon(QIcon.fromTheme('add'))
self.pause_button.setIcon(QIcon.fromTheme('media-playback-pause'))
self.clear_button.setIcon(QIcon.fromTheme('edit-clear'))
self.data_plot = MatHistogramPlot(self)
self.data_plot_layout.addWidget(self.data_plot)
self._topic_completer = TopicCompleter(self.topic_edit)
self._topic_completer.update_topics()
self.topic_edit.setCompleter(self._topic_completer)
self.data_plot.dropEvent = self.dropEvent
self.data_plot.dragEnterEvent = self.dragEnterEvent
self._start_time = rospy.get_time()
self._rosdata = None
if len(topics) != 0:
self.subscribe_topic(topics)
self._update_plot_timer = QTimer(self)
self._update_plot_timer.timeout.connect(self.update_plot)
self._update_plot_timer.start(self._redraw_interval)
开发者ID:CPFL,项目名称:jsk_visualization_packages,代码行数:25,代码来源:hist.py
示例2: __init__
def __init__(self, url=None):
"""
Class to load a webpage in a widget.
:param url: If url is empty then a navigation bar is shown otherwise the url is loaded and the navigation bar is hidden, ''str''
"""
super(WebWidget, self).__init__()
rp = rospkg.RosPack()
ui_file = os.path.join(rp.get_path('rqt_web'), 'resource', 'web_widget.ui')
loadUi(ui_file, self)
self.setObjectName('WebWidget')
self._loading = False
self._stop_icon = QIcon.fromTheme('process-stop')
self._reload_icon = QIcon.fromTheme('view-refresh')
self._working_icon = QIcon.fromTheme('process-working')
self._completer_word_list = ['']
self._view = QWebView()
self.verticalLayout.addWidget(self._view)
if url is None:
self.set_url("http://ros.org", True)
else:
self.set_url(url, False)
self.url_lineedit.returnPressed.connect(self._handle_url_change)
self._view.loadFinished[bool].connect(self._handle_load_finished)
self.reload_button.clicked.connect(self._handle_reload_clicked)
self._view.linkClicked.connect(self._handle_link_clicked)
self._view.urlChanged[QUrl].connect(self._handle_url_changed)
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:30,代码来源:web_widget.py
示例3: __init__
def __init__(self, parent=None, current_values=None):
super(BlacklistDialog, self).__init__(parent)
self.setWindowTitle("Blacklist")
vbox = QVBoxLayout()
self.setLayout(vbox)
self._blacklist = Blacklist()
if isinstance(current_values, list):
for val in current_values:
self._blacklist.append(val)
vbox.addWidget(self._blacklist)
controls_layout = QHBoxLayout()
add_button = QPushButton(icon=QIcon.fromTheme('list-add'))
rem_button = QPushButton(icon=QIcon.fromTheme('list-remove'))
ok_button = QPushButton("Ok")
cancel_button = QPushButton("Cancel")
add_button.clicked.connect(self._add_item)
rem_button.clicked.connect(self._remove_item)
ok_button.clicked.connect(self.accept)
cancel_button.clicked.connect(self.reject)
controls_layout.addWidget(add_button)
controls_layout.addWidget(rem_button)
controls_layout.addStretch(0)
controls_layout.addWidget(ok_button)
controls_layout.addWidget(cancel_button)
vbox.addLayout(controls_layout)
开发者ID:cottsay,项目名称:rqt_graphprofiler,代码行数:28,代码来源:blacklist.py
示例4: __init__
def __init__(self):
super(MessageDataModel, self).__init__()
self._messages = MessageList()
self._message_limit = 20000
self._info_icon = QIcon.fromTheme('dialog-information')
self._warning_icon = QIcon.fromTheme('dialog-warning')
self._error_icon = QIcon.fromTheme('dialog-error')
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:7,代码来源:message_data_model.py
示例5: __init__
def __init__(self, ros_package):
super(GraphWidget, self).__init__()
self._current_graph = None
self._lock = Lock()
self._load_ui(ros_package)
self._scene = QGraphicsScene()
self._scene.setBackgroundBrush(Qt.white)
factory = DmgItemFactory()
factory.set_color(QColor(50, 50, 50))
factory.set_highlighted_color(QColor(0, 150, 0))
self._dot_to_qt = DotToQtGenerator(factory)
self.initialized = False
self.setObjectName('GraphWidget')
self.graphics_view.setScene(self._scene)
self.open_button.setIcon(QIcon.fromTheme('document-open'))
self.open_button.pressed.connect(self._import)
self.export_button.setIcon(QIcon.fromTheme('document-export'))
self.export_button.pressed.connect(self._export)
self.fit_to_view_button.setIcon(QIcon.fromTheme('zoom-fit-best'))
self.fit_to_view_button.pressed.connect(self._fit_to_view)
self.decision_graphs_combo_box.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
self.decision_graphs_combo_box.currentIndexChanged['QString'].connect(self._graph_item_changed)
self._dot_processor = DotProcessor(self._dot_to_qt)
self.decision_graphs = dict()
self.states = dict()
开发者ID:beta-robots,项目名称:decision_making,代码行数:33,代码来源:graph_widget.py
示例6: set_menu
def set_menu(self, menu):
self._menu_manager = MenuManager(menu)
self._perspective_mapper = QSignalMapper(menu)
self._perspective_mapper.mapped[str].connect(self.switch_perspective)
# generate menu
create_action = QAction('&Create perspective...', self._menu_manager.menu)
create_action.setIcon(QIcon.fromTheme('list-add'))
create_action.triggered.connect(self._on_create_perspective)
self._menu_manager.add_suffix(create_action)
self._remove_action = QAction('&Remove perspective...', self._menu_manager.menu)
self._remove_action.setEnabled(False)
self._remove_action.setIcon(QIcon.fromTheme('list-remove'))
self._remove_action.triggered.connect(self._on_remove_perspective)
self._menu_manager.add_suffix(self._remove_action)
self._menu_manager.add_suffix(None)
import_action = QAction('&Import...', self._menu_manager.menu)
import_action.setIcon(QIcon.fromTheme('document-open'))
import_action.triggered.connect(self._on_import_perspective)
self._menu_manager.add_suffix(import_action)
export_action = QAction('&Export...', self._menu_manager.menu)
export_action.setIcon(QIcon.fromTheme('document-save-as'))
export_action.triggered.connect(self._on_export_perspective)
self._menu_manager.add_suffix(export_action)
# add perspectives to menu
for name in self.perspectives:
if not name.startswith(self.HIDDEN_PREFIX):
self._add_perspective_action(name)
开发者ID:abhat91,项目名称:ros_osx,代码行数:33,代码来源:perspective_manager.py
示例7: on_ctrl_list_tree_widget_customContextMenuRequested
def on_ctrl_list_tree_widget_customContextMenuRequested(self, pos):
ctrlman_ns = self.cm_namespace_combo.currentText()
item = self.ctrl_list_tree_widget.itemAt(pos)
if item is None:
return
ctrl_name = item.data(0, Qt.UserRole)
ctrl_state = self._ctrlers[ctrl_name]['state']
# show context menu
menu = QMenu(self)
if ctrl_state == 'running':
action_stop = menu.addAction(
QIcon.fromTheme('media-playback-stop'), 'Stop Controller')
action_kill = menu.addAction(
QIcon.fromTheme('list-remove'), 'Stop and Unload Controller')
elif ctrl_state == 'stopped':
action_start = menu.addAction(
QIcon.fromTheme('media-playback-start'), 'Start Controller')
action_unload = menu.addAction(
QIcon.fromTheme('list-remove'), 'Unload Controller')
action = menu.exec_(self.ctrl_list_tree_widget.mapToGlobal(pos))
# evaluate user action
if ctrl_state == 'running':
if action is action_stop:
self.start_stop_controller(ctrlman_ns, ctrl_name, False)
elif action is action_kill:
self.start_stop_controller(ctrlman_ns, ctrl_name, False)
self.unload_controller(ctrlman_ns, ctrl_name)
elif ctrl_state == 'stopped':
if action is action_start:
self.start_stop_controller(ctrlman_ns, ctrl_name, True)
elif action is action_unload:
self.unload_controller(ctrlman_ns, ctrl_name)
开发者ID:tnn9,项目名称:nurse_robot,代码行数:35,代码来源:controller_manager_gui.py
示例8: __init__
def __init__(self):
QWidget.__init__(self)
rp = rospkg.RosPack()
ui_file = os.path.join(rp.get_path('rqt_bag_annotation'), 'resource', 'export_widget.ui')
loadUi(ui_file, self)
self.add_topic_button.setIcon(QIcon.fromTheme('list-add'))
self.remove_topic_button.setIcon(QIcon.fromTheme('list-remove'))
self.refresh_button.setIcon(QIcon.fromTheme('view-refresh'))
self.add_topic_button.clicked[bool].connect(self._handle_add_topic_clicked)
self.remove_topic_button.clicked[bool].connect(self._handle_remove_topic_clicked)
self.refresh_button.clicked[bool].connect(self._handle_refresh_clicked)
self.export_button.clicked[bool].connect(self._handle_export_clicked)
self.export_location_edit.setPlainText("./export_file.txt")
self.rospack = rospkg.RosPack()
self._exported_topics = list()
self._exported_publisher_info = list()
self._annotations = list()
self._active_topics = list()
self._dt = 0.1
self._current_topic_paths = dict()
self._current_msg_paths = dict()
self._id_counter = 0
self.current_output = ""
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:28,代码来源:export_widget.py
示例9: __init__
def __init__(self, reconf, node_name):
"""
:type reconf: dynamic_reconfigure.client
:type node_name: str
"""
group_desc = reconf.get_group_descriptions()
rospy.logdebug('DynreconfClientWidget.group_desc=%s', group_desc)
super(DynreconfClientWidget, self).__init__(ParamUpdater(reconf),
group_desc, node_name)
# Save and load buttons
self.button_widget = QWidget(self)
self.button_header = QHBoxLayout(self.button_widget)
self.button_header.setContentsMargins(QMargins(0, 0, 0, 0))
self.load_button = QPushButton()
self.save_button = QPushButton()
self.load_button.setIcon(QIcon.fromTheme('document-open'))
self.save_button.setIcon(QIcon.fromTheme('document-save'))
self.load_button.clicked[bool].connect(self._handle_load_clicked)
self.save_button.clicked[bool].connect(self._handle_save_clicked)
self.button_header.addWidget(self.save_button)
self.button_header.addWidget(self.load_button)
self.setMinimumWidth(150)
self.reconf = reconf
self.updater.start()
self.reconf.config_callback = self.config_callback
self._node_grn = node_name
开发者ID:cbandera,项目名称:rqt_common_plugins,代码行数:34,代码来源:dynreconf_client_widget.py
示例10: on_pushButton_calibrate_clicked
def on_pushButton_calibrate_clicked(self):
self._widget.pushButton_calibrate.setEnabled(False)
status_icon = QIcon.fromTheme('stock_no')
# Fill request information
request = self._selected_service['service_class']._request_class()
request.target_hue.data = self._widget.spinBox_hue.value()
request.mult_diffs.data = self._widget.spinBox_diff.value()
request.mult_sat.data = self._widget.spinBox_sat.value()
try:
# Call service
response = self._selected_service['service_proxy'](request)
except rospy.ServiceException as e:
qWarning('on_pushButton_calibrate_clicked(): error calling service "%s":\n%s' % (self._selected_service['service_name'], e))
else:
# Get debug image and show
img = response.image_debug
qImage = QImage(img.data, img.width, img.height, img.step, QImage.Format_RGB888)
qPixmap = QPixmap()
qPixmap.convertFromImage(qImage)
pixmapItem = QGraphicsPixmapItem(qPixmap)
self._qGraphicsScene.clear()
self._qGraphicsScene.addItem(pixmapItem)
self._widget.graphicsView.fitInView(QRectF(qPixmap.rect()), Qt.KeepAspectRatio)
if response.success.data == True:
status_icon = QIcon.fromTheme('stock_yes')
self._widget.label_status.setPixmap(status_icon.pixmap(status_icon.actualSize(QSize(24, 24))))
self._widget.pushButton_calibrate.setEnabled(True)
开发者ID:minolo,项目名称:robostylus,代码行数:34,代码来源:rqt_calibrate.py
示例11: __init__
def __init__(self):
super(MainWidget, self).__init__()
self.setObjectName('MainWidget')
rospack = rospkg.RosPack()
ui_file = rospack.get_path('rqt_joint_trajectory_plot')+'/resource/JointTrajectoryPlot.ui'
loadUi(ui_file, self)
self.refresh_button.setIcon(QIcon.fromTheme('reload'))
self.pause_button.setIcon(QIcon.fromTheme('media-playback-pause'))
self.handler = None
self.joint_names = []
self.timer = QTimer(self)
self.timer.timeout.connect(self.update)
self.plot_widget = PlotWidget(self)
self.plot_layout.addWidget(self.plot_widget)
self.draw_curves.connect(self.plot_widget.draw_curves)
self.time = None
(self.dis, self.vel, self.acc, self.eff) = ({}, {}, {}, {})
# refresh topics list in the combobox
self.refresh_topics()
self.change_topic()
self.refresh_button.clicked.connect(self.refresh_topics)
self.topic_combox.currentIndexChanged.connect(self.change_topic)
self.select_tree.itemChanged.connect(self.update_checkbox)
开发者ID:aaravrav142,项目名称:rqt_joint_trajectory_plot,代码行数:29,代码来源:main_widget.py
示例12: __init__
def __init__(self, initial_topics=None, start_paused=False):
super(PlotWidget, self).__init__()
self.setObjectName('PlotWidget')
self._initial_topics = initial_topics
rp = rospkg.RosPack()
ui_file = os.path.join(rp.get_path('rqt_plot'), 'resource', 'plot.ui')
loadUi(ui_file, self)
self.subscribe_topic_button.setIcon(QIcon.fromTheme('list-add'))
self.remove_topic_button.setIcon(QIcon.fromTheme('list-remove'))
self.pause_button.setIcon(QIcon.fromTheme('media-playback-pause'))
self.clear_button.setIcon(QIcon.fromTheme('edit-clear'))
self.data_plot = None
self.subscribe_topic_button.setEnabled(False)
if start_paused:
self.pause_button.setChecked(True)
self._topic_completer = TopicCompleter(self.topic_edit)
self._topic_completer.update_topics()
self.topic_edit.setCompleter(self._topic_completer)
self._start_time = rospy.get_time()
self._rosdata = {}
self._remove_topic_menu = QMenu()
# init and start update timer for plot
self._update_plot_timer = QTimer(self)
self._update_plot_timer.timeout.connect(self.update_plot)
开发者ID:Rescube,项目名称:rqt_common_plugins,代码行数:30,代码来源:plot_widget.py
示例13: __init__
def __init__(self):
super(ServiceCallerWidget, self).__init__()
self.setObjectName('ServiceCallerWidget')
# create context for the expression eval statement
self._eval_locals = {}
for module in (math, random, time):
self._eval_locals.update(module.__dict__)
self._eval_locals['genpy'] = genpy
del self._eval_locals['__name__']
del self._eval_locals['__doc__']
rp = rospkg.RosPack()
ui_file = os.path.join(rp.get_path('rqt_service_caller'), 'resource', 'ServiceCaller.ui')
loadUi(ui_file, self, {'ExtendedComboBox': ExtendedComboBox})
self.refresh_services_button.setIcon(QIcon.fromTheme('view-refresh'))
self.call_service_button.setIcon(QIcon.fromTheme('call-start'))
self._column_index = {}
for column_name in self.column_names:
self._column_index[column_name] = len(self._column_index)
self._service_info = None
self.on_refresh_services_button_clicked()
self.request_tree_widget.itemChanged.connect(self.request_tree_widget_itemChanged)
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:26,代码来源:service_caller_widget.py
示例14: __init__
def __init__(self, parent=None):
super(PublisherTreeWidget, self).__init__(parent)
self.setModel(PublisherTreeModel(self))
self._action_remove_publisher = QAction(QIcon.fromTheme('list-remove'), 'Remove Selected', self)
self._action_remove_publisher.triggered[bool].connect(self._handle_action_remove_publisher)
self._action_publish_once = QAction(QIcon.fromTheme('media-playback-start'), 'Publish Selected Once', self)
self._action_publish_once.triggered[bool].connect(self._handle_action_publish_once)
self.setItemDelegateForColumn(self.model()._column_index['rate'], SpinBoxDelegate(min_value=0, max_value=1000000, decimals=2))
开发者ID:Rescube,项目名称:rqt_common_plugins,代码行数:8,代码来源:publisher_tree_widget.py
示例15: __init__
def __init__(self, parent=None):
super(PublisherTreeWidget, self).__init__(parent)
self.setModel(PublisherTreeModel(self))
self._action_remove_publisher = QAction(QIcon.fromTheme('list-remove'), 'Remove Selected', self)
self._action_remove_publisher.triggered[bool].connect(self._handle_action_remove_publisher)
self._action_publish_once = QAction(QIcon.fromTheme('media-playback-start'), 'Publish Selected Once', self)
self._action_publish_once.triggered[bool].connect(self._handle_action_publish_once)
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:8,代码来源:publisher_tree_widget.py
示例16: _pause_resume_plots
def _pause_resume_plots(self):
if self.pause is 0:
self.pause = 1
self._widget.pause_resume_plot_button.setIcon(QIcon.fromTheme('media-playback-start'))
self._widget.pause_resume_plot_button.setText("Resume")
else:
self.pause = 0
self._widget.pause_resume_plot_button.setIcon(QIcon.fromTheme('media-playback-pause'))
self._widget.pause_resume_plot_button.setText("Pause")
开发者ID:MorS25,项目名称:rqt_copter,代码行数:9,代码来源:rqt_copter.py
示例17: __init__
def __init__(self, context):
super(KinestheticTeachingWidget, self).__init__()
ui_file = os.path.join(rospkg.RosPack().get_path('rqt_kinesthetic_teaching'), 'resource', 'KinestheticTeaching.ui')
loadUi(ui_file, self)
self.setObjectName('KTeachingUi')
self.setWindowTitle(self.windowTitle() + (' (%d)' % context.serial_number()))
# Add widget to the user interface
context.add_widget(self)
# Set icons for buttons because they don't persist frm Qt creator for some reason
self.demoLocationSaveButton.setIcon(QIcon.fromTheme("document-save-as"))
self.demoLocationButton.setIcon(QIcon.fromTheme("document-open"))
self.demoFolderLocationButton.setIcon(QIcon.fromTheme("folder"))
self.playDemoButton.setIcon(QIcon.fromTheme("media-playback-start"))
# Attach event handlers
self.demoLocationButton.clicked[bool].connect(self.browseForLocation)
self.demoFolderLocationButton.clicked[bool].connect(self.browseForFolder)
self.demoLocationSaveButton.clicked[bool].connect(self.newLocation)
self.demoLocation.returnPressed.connect(self.loadLocation)
self.startTrajectoryButton.clicked[bool].connect(self.startTrajectory)
self.startButton.clicked[bool].connect(self.startKeyframe)
self.addButton.clicked[bool].connect(self.addKeyframe)
self.openHandButton.clicked[bool].connect(self.openHand)
self.closeHandButton.clicked[bool].connect(self.closeHand)
self.endButton.clicked[bool].connect(self.endKeyframe)
self.playDemoButton.clicked[bool].connect(self.playDemo)
self.enableKIBox.stateChanged.connect(self.enableKI)
self.locateObjectsBox.stateChanged.connect(self.locateObjectsChanged)
# Set sizing options for tree widget headers
self.playbackTree.header().setStretchLastSection(False)
self.playbackTree.header().setResizeMode(0, QHeaderView.Stretch)
self.playbackTree.header().setResizeMode(1, QHeaderView.ResizeToContents)
self.zeroMarker.setInsertPolicy(QComboBox.InsertAlphabetically)
# Initialize the demonstration recorder
self.kinesthetic_interaction = None
try:
self.kinesthetic_interaction = RQTKinestheticInteraction()
print "Waiting for RQT kinesthetic interaction service"
rospy.wait_for_service("kinesthetic_interaction")
self.enable_kinesthetic_service = rospy.ServiceProxy("kinesthetic_interaction", KinestheticInteract)
self.enable_kinesthetic_service(True)
# Register callbacks
self.kinesthetic_interaction.start_trajectory_cb = self.startTrajectoryCallback
self.kinesthetic_interaction.start_keyframe_cb = self.startKeyframeCallback
self.kinesthetic_interaction.add_keyframe_cb = self.addKeyframeCallback
self.kinesthetic_interaction.end_keyframe_cb = self.endKeyframeCallback
except TimeoutException as err:
self._showWarning("Record keyframe demo server unreachable", str(err))
self.keyframeBagInterface = None
开发者ID:HLP-R,项目名称:hlpr_kinesthetic_teaching,代码行数:55,代码来源:kinesthetic_teaching_widget.py
示例18: __init__
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,代码行数:54,代码来源:menu_rqt.py
示例19: __init__
def __init__(self, dock_widget, qtgui_path):
super(DockWidgetTitleBar, self).__init__(dock_widget)
self._dock_widget = dock_widget
self.hide_title_bar = False
ui_file = os.path.join(qtgui_path, 'resource', 'dock_widget_title_bar.ui')
loadUi(ui_file, self)
self._extra_buttons = {
'configuration': self.configuration_button,
'reload': self.reload_button,
'help': self.help_button,
'close': self.close_button,
}
icon = QIcon.fromTheme('emblem-system')
if not icon.isNull():
self.configuration_button.setIcon(icon)
self.configuration_button.setText("")
icon = QIcon.fromTheme('view-refresh')
if not icon.isNull():
self.reload_button.setIcon(icon)
self.reload_button.setText("")
icon = QIcon.fromTheme('help-browser')
if not icon.isNull():
self.help_button.setIcon(icon)
self.help_button.setText("")
icon = QIcon.fromTheme('window-close')
if not icon.isNull():
self.close_button.setIcon(icon)
self.close_button.setText("")
self.close_button.clicked.connect(self._close_clicked)
self.float_button.clicked.connect(self._toggle_floating)
self.dockable_button.clicked[bool].connect(self._toggle_dockable)
self.minimize_button.clicked.connect(self._minimize_dock_widget)
self._dock_widget.featuresChanged.connect(self._features_changed)
self._features_changed()
self._update_icon()
self._update_title()
self._close_callbacks = []
self._event_callbacks = {
QEvent.WindowIconChange: self._update_icon,
QEvent.WindowTitleChange: self._update_title,
}
self._dock_widget.installEventFilter(self)
self.title_label.installEventFilter(self)
self.title_edit.hide()
self.title_edit.editingFinished.connect(self._finished_editing)
self.title_edit.returnPressed.connect(self._update_title_label)
开发者ID:ethz-asl,项目名称:qt_gui_core,代码行数:54,代码来源:dock_widget_title_bar.py
示例20: __init__
def __init__(self, parent=None):
super(MessageTreeWidget, self).__init__(parent)
self.setDragEnabled(True)
self.sortByColumn(0, Qt.AscendingOrder)
self.header().setResizeMode(QHeaderView.ResizeToContents)
self.header().setContextMenuPolicy(Qt.CustomContextMenu)
self.header().customContextMenuRequested.connect(self.handle_header_view_customContextMenuRequested)
self._action_item_expand = QAction(QIcon.fromTheme('zoom-in'), 'Expand Selected', self)
self._action_item_expand.triggered.connect(self._handle_action_item_expand)
self._action_item_collapse = QAction(QIcon.fromTheme('zoom-out'), 'Collapse Selected', self)
self._action_item_collapse.triggered.connect(self._handle_action_item_collapse)
self.customContextMenuRequested.connect(self.handle_customContextMenuRequested)
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:14,代码来源:message_tree_widget.py
注:本文中的python_qt_binding.QtGui.QIcon类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论