本文整理汇总了Python中spyderlib.utils.qthelpers.get_icon函数的典型用法代码示例。如果您正苦于以下问题:Python get_icon函数的具体用法?Python get_icon怎么用?Python get_icon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_icon函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setup_common_actions
def setup_common_actions(self):
"""Setup context menu common actions"""
self.collapse_all_action = create_action(self,
text=_('Collapse all'),
icon=get_icon('collapse.png'),
triggered=self.collapseAll)
self.expand_all_action = create_action(self,
text=_('Expand all'),
icon=get_icon('expand.png'),
triggered=self.expandAll)
self.restore_action = create_action(self,
text=_('Restore'),
tip=_('Restore original tree layout'),
icon=get_icon('restore.png'),
triggered=self.restore)
self.collapse_selection_action = create_action(self,
text=_('Collapse selection'),
icon=get_icon('collapse_selection.png'),
triggered=self.collapse_selection)
self.expand_selection_action = create_action(self,
text=_('Expand selection'),
icon=get_icon('expand_selection.png'),
triggered=self.expand_selection)
return [self.collapse_all_action, self.expand_all_action,
self.restore_action, None,
self.collapse_selection_action, self.expand_selection_action]
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:26,代码来源:onecolumntree.py
示例2: get_toolbar_buttons
def get_toolbar_buttons(self):
ExternalShellBase.get_toolbar_buttons(self)
if self.namespacebrowser_button is None and self.stand_alone is not None:
self.namespacebrowser_button = create_toolbutton(
self,
text=_("Variables"),
icon=get_icon("dictedit.png"),
tip=_("Show/hide global variables explorer"),
toggled=self.toggle_globals_explorer,
text_beside_icon=True,
)
if self.terminate_button is None:
self.terminate_button = create_toolbutton(
self,
text=_("Terminate"),
icon=get_icon("stop.png"),
tip=_(
"Attempts to stop the process. The process\n"
"may not exit as a result of clicking this\n"
"button (it is given the chance to prompt\n"
"the user for any unsaved files, etc)."
),
)
buttons = []
if self.namespacebrowser_button is not None:
buttons.append(self.namespacebrowser_button)
buttons += [self.run_button, self.terminate_button, self.kill_button, self.options_button]
return buttons
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:28,代码来源:pythonshell.py
示例3: create_scedit
def create_scedit(self, text, option, default=NoDefault, tip=None,
without_layout=False):
label = QLabel(text)
clayout = ColorLayout(QColor(Qt.black), self)
clayout.lineedit.setMaximumWidth(80)
if tip is not None:
clayout.setToolTip(tip)
cb_bold = QCheckBox()
cb_bold.setIcon(get_icon("bold.png"))
cb_bold.setToolTip(_("Bold"))
cb_italic = QCheckBox()
cb_italic.setIcon(get_icon("italic.png"))
cb_italic.setToolTip(_("Italic"))
self.scedits[(clayout, cb_bold, cb_italic)] = (option, default)
if without_layout:
return label, clayout, cb_bold, cb_italic
layout = QHBoxLayout()
layout.addWidget(label)
layout.addLayout(clayout)
layout.addSpacing(10)
layout.addWidget(cb_bold)
layout.addWidget(cb_italic)
layout.addStretch(1)
layout.setContentsMargins(0, 0, 0, 0)
widget = QWidget(self)
widget.setLayout(layout)
return widget
开发者ID:jromang,项目名称:spyderlib,代码行数:27,代码来源:configdialog.py
示例4: __init__
def __init__(self, parent):
QWebView.__init__(self, parent)
self.zoom_factor = 1.0
self.zoom_out_action = create_action(
self, _("Zoom out"), icon=get_icon("zoom_out.png"), triggered=self.zoom_out
)
self.zoom_in_action = create_action(self, _("Zoom in"), icon=get_icon("zoom_in.png"), triggered=self.zoom_in)
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:7,代码来源:browser.py
示例5: __init__
def __init__(self, parent=None, name_filters=['*.py', '*.pyw'],
valid_types=('.py', '.pyw'), show_all=False,
show_cd_only=None, show_toolbar=True, show_icontext=True):
QWidget.__init__(self, parent)
self.treewidget = ExplorerTreeWidget(self, show_cd_only=show_cd_only)
self.treewidget.setup(name_filters=name_filters,
valid_types=valid_types, show_all=show_all)
self.treewidget.chdir(getcwd())
toolbar_action = create_action(self, _("Show toolbar"),
toggled=self.toggle_toolbar)
icontext_action = create_action(self, _("Show icons and text"),
toggled=self.toggle_icontext)
self.treewidget.common_actions += [None,
toolbar_action, icontext_action]
# Setup toolbar
self.toolbar = QToolBar(self)
self.toolbar.setIconSize(QSize(16, 16))
self.previous_action = create_action(self, text=_("Previous"),
icon=get_icon('previous.png'),
triggered=self.treewidget.go_to_previous_directory)
self.toolbar.addAction(self.previous_action)
self.previous_action.setEnabled(False)
self.connect(self.treewidget, SIGNAL("set_previous_enabled(bool)"),
self.previous_action.setEnabled)
self.next_action = create_action(self, text=_("Next"),
icon=get_icon('next.png'),
triggered=self.treewidget.go_to_next_directory)
self.toolbar.addAction(self.next_action)
self.next_action.setEnabled(False)
self.connect(self.treewidget, SIGNAL("set_next_enabled(bool)"),
self.next_action.setEnabled)
parent_action = create_action(self, text=_("Parent"),
icon=get_icon('up.png'),
triggered=self.treewidget.go_to_parent_directory)
self.toolbar.addAction(parent_action)
options_action = create_action(self, text='', tip=_("Options"),
icon=get_icon('tooloptions.png'))
self.toolbar.addAction(options_action)
widget = self.toolbar.widgetForAction(options_action)
widget.setPopupMode(QToolButton.InstantPopup)
menu = QMenu(self)
add_actions(menu, self.treewidget.common_actions)
options_action.setMenu(menu)
toolbar_action.setChecked(show_toolbar)
self.toggle_toolbar(show_toolbar)
icontext_action.setChecked(show_icontext)
self.toggle_icontext(show_icontext)
vlayout = QVBoxLayout()
vlayout.addWidget(self.toolbar)
vlayout.addWidget(self.treewidget)
self.setLayout(vlayout)
开发者ID:jromang,项目名称:spyderlib,代码行数:60,代码来源:explorer.py
示例6: setup_top_toolbar
def setup_top_toolbar(self, layout):
toolbar = []
movetop_button = create_toolbutton(self,
text=_("Move to top"),
icon=get_icon('2uparrow.png'),
triggered=lambda: self.move_to(absolute=0),
text_beside_icon=True)
toolbar.append(movetop_button)
moveup_button = create_toolbutton(self,
text=_("Move up"),
icon=get_icon('1uparrow.png'),
triggered=lambda: self.move_to(relative=-1),
text_beside_icon=True)
toolbar.append(moveup_button)
movedown_button = create_toolbutton(self,
text=_("Move down"),
icon=get_icon('1downarrow.png'),
triggered=lambda: self.move_to(relative=1),
text_beside_icon=True)
toolbar.append(movedown_button)
movebottom_button = create_toolbutton(self,
text=_("Move to bottom"),
icon=get_icon('2downarrow.png'),
triggered=lambda: self.move_to(absolute=1),
text_beside_icon=True)
toolbar.append(movebottom_button)
self.selection_widgets.extend(toolbar)
self._add_widgets_to_layout(layout, toolbar)
return toolbar
开发者ID:jromang,项目名称:spyderlib,代码行数:29,代码来源:pathmanager.py
示例7: add_history
def add_history(self, filename):
"""
Add new history tab
Slot for add_history signal emitted by shell instance
"""
filename = encoding.to_unicode_from_fs(filename)
if filename in self.filenames:
return
editor = codeeditor.CodeEditor(self)
if osp.splitext(filename)[1] == '.py':
language = 'py'
icon = get_icon('python.png')
else:
language = 'bat'
icon = get_icon('cmdprompt.png')
editor.setup_editor(linenumbers=False, language=language,
scrollflagarea=False)
editor.focus_changed.connect(lambda: self.focus_changed.emit())
editor.setReadOnly(True)
color_scheme = get_color_scheme(self.get_option('color_scheme_name'))
editor.set_font( self.get_plugin_font(), color_scheme )
editor.toggle_wrap_mode( self.get_option('wrap') )
text, _ = encoding.read(filename)
editor.set_text(text)
editor.set_cursor_position('eof')
self.editors.append(editor)
self.filenames.append(filename)
self.icons.append(icon)
index = self.tabwidget.addTab(editor, osp.basename(filename))
self.find_widget.set_editor(editor)
self.tabwidget.setTabToolTip(index, filename)
self.tabwidget.setTabIcon(index, icon)
self.tabwidget.setCurrentIndex(index)
开发者ID:Micseb,项目名称:spyder,代码行数:35,代码来源:history.py
示例8: add_history
def add_history(self, filename):
"""
Add new history tab
Slot for SIGNAL('add_history(QString)') emitted by shell instance
"""
filename = encoding.to_unicode_from_fs(filename)
if filename in self.filenames:
return
editor = codeeditor.CodeEditor(self)
if osp.splitext(filename)[1] == ".py":
language = "py"
icon = get_icon("python.png")
else:
language = "bat"
icon = get_icon("cmdprompt.png")
editor.setup_editor(linenumbers=False, language=language, scrollflagarea=False)
self.connect(editor, SIGNAL("focus_changed()"), lambda: self.emit(SIGNAL("focus_changed()")))
editor.setReadOnly(True)
color_scheme = get_color_scheme(self.get_option("color_scheme_name"))
editor.set_font(self.get_plugin_font(), color_scheme)
editor.toggle_wrap_mode(self.get_option("wrap"))
text, _ = encoding.read(filename)
editor.set_text(text)
editor.set_cursor_position("eof")
self.editors.append(editor)
self.filenames.append(filename)
self.icons.append(icon)
index = self.tabwidget.addTab(editor, osp.basename(filename))
self.find_widget.set_editor(editor)
self.tabwidget.setTabToolTip(index, filename)
self.tabwidget.setTabIcon(index, icon)
self.tabwidget.setCurrentIndex(index)
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:34,代码来源:history.py
示例9: get_options_menu
def get_options_menu(self):
ExternalShellBase.get_options_menu(self)
self.interact_action = create_action(self, _("Interact"))
self.interact_action.setCheckable(True)
self.debug_action = create_action(self, _("Debug"))
self.debug_action.setCheckable(True)
self.args_action = create_action(self, _("Arguments..."),
triggered=self.get_arguments)
self.post_mortem_action = create_action(self, _("Post Mortem Debug"))
self.post_mortem_action.setCheckable(True)
run_settings_menu = QMenu(_("Run settings"), self)
add_actions(run_settings_menu,
(self.interact_action, self.debug_action, self.args_action,
self.post_mortem_action))
self.cwd_button = create_action(self, _("Working directory"),
icon=get_std_icon('DirOpenIcon'),
tip=_("Set current working directory"),
triggered=self.set_current_working_directory)
self.env_button = create_action(self, _("Environment variables"),
icon=get_icon('environ.png'),
triggered=self.show_env)
self.syspath_button = create_action(self,
_("Show sys.path contents"),
icon=get_icon('syspath.png'),
triggered=self.show_syspath)
actions = [run_settings_menu, self.show_time_action, None,
self.cwd_button, self.env_button, self.syspath_button]
if self.menu_actions is not None:
actions += [None]+self.menu_actions
return actions
开发者ID:Micseb,项目名称:spyder,代码行数:30,代码来源:pythonshell.py
示例10: get_toolbar_buttons
def get_toolbar_buttons(self):
if self.run_button is None:
self.run_button = create_toolbutton(self, text=_("Run"),
icon=get_icon('run.png'),
tip=_("Run again this program"),
triggered=self.start_shell)
if self.kill_button is None:
self.kill_button = create_toolbutton(self, text=_("Kill"),
icon=get_icon('kill.png'),
tip=_("Kills the current process, "
"causing it to exit immediately"))
buttons = [self.run_button]
if self.options_button is None:
options = self.get_options_menu()
if options:
self.options_button = create_toolbutton(self, text=_("Options"),
icon=get_icon('tooloptions.png'))
self.options_button.setPopupMode(QToolButton.InstantPopup)
menu = QMenu(self)
add_actions(menu, options)
self.options_button.setMenu(menu)
if self.options_button is not None:
buttons.append(self.options_button)
buttons.append(self.kill_button)
return buttons
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:25,代码来源:baseshell.py
示例11: get_toolbar_buttons
def get_toolbar_buttons(self):
"""Return toolbar buttons list"""
#TODO: Eventually add some buttons (Empty for now)
# (see for example: spyderlib/widgets/externalshell/baseshell.py)
buttons = []
# Code to add the stop button
if self.stop_button is None:
self.stop_button = create_toolbutton(self, text=_("Stop"),
icon=self.stop_icon,
tip=_("Stop the current command"))
self.disable_stop_button()
# set click event handler
self.stop_button.clicked.connect(self.stop_button_click_handler)
if self.stop_button is not None:
buttons.append(self.stop_button)
if self.options_button is None:
options = self.get_options_menu()
if options:
self.options_button = create_toolbutton(self,
text=_("Options"), icon=get_icon('tooloptions.png'))
self.options_button.setPopupMode(QToolButton.InstantPopup)
menu = QMenu(self)
add_actions(menu, options)
self.options_button.setMenu(menu)
if self.options_button is not None:
buttons.append(self.options_button)
return buttons
开发者ID:jayitb,项目名称:Spyderplugin_ratelaws,代码行数:29,代码来源:ipython.py
示例12: __init__
def __init__(self, parent, actions=None, menu=None,
corner_widgets=None, menu_use_tooltips=False):
QTabWidget.__init__(self, parent)
self.setUsesScrollButtons(True)
self.corner_widgets = {}
self.menu_use_tooltips = menu_use_tooltips
if menu is None:
self.menu = QMenu(self)
if actions:
add_actions(self.menu, actions)
else:
self.menu = menu
# Corner widgets
if corner_widgets is None:
corner_widgets = {}
corner_widgets.setdefault(Qt.TopLeftCorner, [])
corner_widgets.setdefault(Qt.TopRightCorner, [])
self.browse_button = create_toolbutton(self,
icon=get_icon("browse_tab.png"),
tip=_("Browse tabs"))
self.browse_tabs_menu = QMenu(self)
self.browse_button.setMenu(self.browse_tabs_menu)
self.browse_button.setPopupMode(self.browse_button.InstantPopup)
self.browse_tabs_menu.aboutToShow.connect(self.update_browse_tabs_menu)
corner_widgets[Qt.TopLeftCorner] += [self.browse_button]
self.set_corner_widgets(corner_widgets)
开发者ID:Micseb,项目名称:spyder,代码行数:31,代码来源:tabs.py
示例13: setup_menu
def setup_menu(self):
"""Setup context menu"""
copy_action = create_action(
self,
_("Copy"),
shortcut=keybinding("Copy"),
icon=get_icon("editcopy.png"),
triggered=self.copy,
context=Qt.WidgetShortcut,
)
functions = (
(_("To bool"), bool),
(_("To complex"), complex),
(_("To int"), int),
(_("To float"), float),
(_("To str"), to_text_string),
)
types_in_menu = [copy_action]
for name, func in functions:
types_in_menu += [
create_action(self, name, triggered=lambda func=func: self.change_type(func), context=Qt.WidgetShortcut)
]
menu = QMenu(self)
add_actions(menu, types_in_menu)
return menu
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:25,代码来源:dataframeeditor.py
示例14: get_options_menu
def get_options_menu(self):
"""Return options menu"""
# Kernel
self.interrupt_action = create_action(self, _("Interrupt kernel"),
icon=get_icon('terminate.png'),
triggered=self.interrupt_kernel)
self.restart_action = create_action(self, _("Restart kernel"),
icon=get_icon('restart.png'),
triggered=self.restart_kernel)
# Main menu
if self.menu_actions is not None:
actions = [self.interrupt_action, self.restart_action, None] +\
self.menu_actions
else:
actions = [self.interrupt_action, self.restart_action]
return actions
开发者ID:jromang,项目名称:spyderlib,代码行数:16,代码来源:ipython.py
示例15: setup_and_check
def setup_and_check(self, data, title=''):
"""
Setup DataFrameEditor:
return False if data is not supported, True otherwise
"""
self.layout = QGridLayout()
self.setLayout(self.layout)
self.setWindowIcon(get_icon('arredit.png'))
if title:
title = to_text_string(title) # in case title is not a string
else:
title = _("%s editor") % data.__class__.__name__
if isinstance(data, TimeSeries):
self.is_time_series = True
data = data.to_frame()
self.setWindowTitle(title)
self.resize(600, 500)
self.dataModel = DataFrameModel(data, parent=self)
self.dataTable = DataFrameView(self, self.dataModel)
self.layout.addWidget(self.dataTable)
self.setLayout(self.layout)
self.setMinimumSize(400, 300)
# Make the dialog act as a window
self.setWindowFlags(Qt.Window)
btn_layout = QHBoxLayout()
btn = QPushButton(_("Format"))
# disable format button for int type
btn_layout.addWidget(btn)
btn.clicked.connect(self.change_format)
btn = QPushButton(_('Resize'))
btn_layout.addWidget(btn)
btn.clicked.connect(self.dataTable.resizeColumnsToContents)
bgcolor = QCheckBox(_('Background color'))
bgcolor.setChecked(self.dataModel.bgcolor_enabled)
bgcolor.setEnabled(self.dataModel.bgcolor_enabled)
bgcolor.stateChanged.connect(self.change_bgcolor_enable)
btn_layout.addWidget(bgcolor)
self.bgcolor_global = QCheckBox(_('Column min/max'))
self.bgcolor_global.setChecked(self.dataModel.colum_avg_enabled)
self.bgcolor_global.setEnabled(not self.is_time_series and
self.dataModel.bgcolor_enabled)
self.bgcolor_global.stateChanged.connect(self.dataModel.colum_avg)
btn_layout.addWidget(self.bgcolor_global)
btn_layout.addStretch()
bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
bbox.accepted.connect(self.accept)
bbox.rejected.connect(self.reject)
btn_layout.addWidget(bbox)
self.layout.addLayout(btn_layout, 2, 0)
return True
开发者ID:Micseb,项目名称:spyder,代码行数:59,代码来源:dataframeeditor.py
示例16: get_plugin_icon
def get_plugin_icon(self):
"""
Return plugin icon (QIcon instance)
Note: this is required for plugins creating a main window
(see SpyderPluginMixin.create_mainwindow)
and for configuration dialog widgets creation
"""
return get_icon('qt.png')
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:8,代码来源:__init__.py
示例17: setup_menu
def setup_menu(self):
"""Setup context menu"""
self.copy_action = create_action(self, _( "Copy"),
shortcut=keybinding("Copy"),
icon=get_icon('editcopy.png'),
triggered=self.copy,
context=Qt.WidgetShortcut)
menu = QMenu(self)
add_actions(menu, [self.copy_action, ])
return menu
开发者ID:jromang,项目名称:spyderlib,代码行数:10,代码来源:arrayeditor.py
示例18: add_actions_to_context_menu
def add_actions_to_context_menu(self, menu):
"""Add actions to IPython widget context menu"""
# See spyderlib/widgets/ipython.py for more details on this method
inspect_action = create_action(self, _("Inspect current object"),
QKeySequence("Ctrl+I"),
icon=get_std_icon('MessageBoxInformation'),
triggered=self.inspect_object)
clear_line_action = create_action(self, _("Clear line or block"),
QKeySequence("Shift+Escape"),
icon=get_icon('eraser.png'),
triggered=self.clear_line)
clear_console_action = create_action(self, _("Clear console"),
QKeySequence("Ctrl+L"),
icon=get_icon('clear.png'),
triggered=self.clear_console)
quit_action = create_action(self, _("&Quit"), icon='exit.png',
triggered=self.exit_callback)
add_actions(menu, (None, inspect_action, clear_line_action,
clear_console_action, None, quit_action))
return menu
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:20,代码来源:ipython.py
示例19: setup_context_menu
def setup_context_menu(self):
"""Reimplements ShellBaseWidget method"""
ShellBaseWidget.setup_context_menu(self)
self.copy_without_prompts_action = create_action(self,
_("Copy without prompts"),
icon=get_icon('copywop.png'),
triggered=self.copy_without_prompts)
clear_line_action = create_action(self, _("Clear line"),
QKeySequence("Shift+Escape"),
icon=get_icon('eraser.png'),
tip=_("Clear line"),
triggered=self.clear_line)
clear_action = create_action(self, _("Clear shell"),
QKeySequence("Ctrl+L"),
icon=get_icon('clear.png'),
tip=_("Clear shell contents "
"('cls' command)"),
triggered=self.clear_terminal)
add_actions(self.menu, (self.copy_without_prompts_action,
clear_line_action, clear_action))
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:20,代码来源:shell.py
示例20: add_tab
def add_tab(self, widget, name):
"""Add tab"""
self.clients.append(widget)
index = self.tabwidget.addTab(widget, get_icon('ipython_console.png'),
name)
self.tabwidget.setCurrentIndex(index)
if self.dockwidget and not self.ismaximized:
self.dockwidget.setVisible(True)
self.dockwidget.raise_()
self.activateWindow()
widget.get_control().setFocus()
开发者ID:Poneyo,项目名称:spyderlib,代码行数:11,代码来源:ipythonconsole.py
注:本文中的spyderlib.utils.qthelpers.get_icon函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论