• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python qthelpers.create_toolbutton函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中spyderlib.utils.qthelpers.create_toolbutton函数的典型用法代码示例。如果您正苦于以下问题:Python create_toolbutton函数的具体用法?Python create_toolbutton怎么用?Python create_toolbutton使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: 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


示例2: setup_bottom_toolbar

 def setup_bottom_toolbar(self, layout, sync=True):
     toolbar = []
     add_button = create_toolbutton(
         self, text=_("Add path"), icon=get_icon("edit_add.png"), triggered=self.add_path, text_beside_icon=True
     )
     toolbar.append(add_button)
     remove_button = create_toolbutton(
         self,
         text=_("Remove path"),
         icon=get_icon("edit_remove.png"),
         triggered=self.remove_path,
         text_beside_icon=True,
     )
     toolbar.append(remove_button)
     self.selection_widgets.append(remove_button)
     self._add_widgets_to_layout(layout, toolbar)
     layout.addStretch(1)
     if os.name == "nt" and sync:
         self.sync_button = create_toolbutton(
             self,
             text=_("Synchronize..."),
             icon=get_icon("synchronize.png"),
             triggered=self.synchronize,
             tip=_("Synchronize Spyder's path list with PYTHONPATH " "environment variable"),
             text_beside_icon=True,
         )
         layout.addWidget(self.sync_button)
     return toolbar
开发者ID:jromang,项目名称:retina-old,代码行数:28,代码来源:pathmanager.py


示例3: get_toolbar_buttons

 def get_toolbar_buttons(self):
     ExternalShellBase.get_toolbar_buttons(self)
     if self.namespacebrowser_button is None and self.stand_alone:
         self.namespacebrowser_button = create_toolbutton(self,
                       get_icon('dictedit.png'), self.tr("Variables"),
                       tip=self.tr("Show/hide global variables explorer"),
                       toggled=self.toggle_globals_explorer)
     if self.cwd_button is None:
         self.cwd_button = create_toolbutton(self,
                       get_std_icon('DirOpenIcon'), self.tr("Working directory"),
                       tip=self.tr("Set current working directory"),
                       triggered=self.set_current_working_directory)
     if self.terminate_button is None:
         self.terminate_button = create_toolbutton(self,
                       get_icon('terminate.png'), self.tr("Terminate"),
                       tip=self.tr("Attempts to terminate the process.\n"
                                   "The process may not exit as a result of "
                                   "clicking this button\n"
                                   "(it is given the chance to prompt "
                                   "the user for any unsaved files, etc)."))        
     buttons = [self.cwd_button]
     if self.namespacebrowser_button is not None:
         buttons.append(self.namespacebrowser_button)
     buttons += [self.run_button, self.options_button,
                 self.terminate_button, self.kill_button]
     return buttons
开发者ID:cheesinglee,项目名称:spyder,代码行数:26,代码来源:pythonshell.py


示例4: get_toolbar_buttons

 def get_toolbar_buttons(self):
     if self.run_button is None:
         self.run_button = create_toolbutton(
             self, text=_("Run"), icon=ima.icon("run"), tip=_("Run again this program"), triggered=self.start_shell
         )
     if self.kill_button is None:
         self.kill_button = create_toolbutton(
             self,
             text=_("Kill"),
             icon=ima.icon("kill"),
             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=ima.icon("tooloptions"))
             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:gyenney,项目名称:Tools,代码行数:25,代码来源:baseshell.py


示例5: 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=ima.icon('tooloptions'))
                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:MarvinLiu0810,项目名称:spyder,代码行数:29,代码来源:ipython.py


示例6: 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


示例7: get_toolbar_buttons

 def get_toolbar_buttons(self):
     if self.run_button is None:
         self.run_button = create_toolbutton(self, get_icon('run.png'),
                           translate('ExternalShellBase', "Run"),
                           tip=translate('ExternalShellBase',
                                         "Run again this program"),
                           triggered=self.start)
     if self.kill_button is None:
         self.kill_button = create_toolbutton(self, get_icon('kill.png'),
                           translate('ExternalShellBase', "Kill"),
                           tip=translate('ExternalShellBase',
                                         "Kills the current process, "
                                         "causing it to exit immediately"))
     buttons = [self.run_button, self.kill_button]
     if self.options_button is None:
         options = self.get_options_menu()
         if options:
             self.options_button = create_toolbutton(self,
                                         text=self.tr("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.insert(1, self.options_button)
     return buttons
开发者ID:cheesinglee,项目名称:spyder,代码行数:27,代码来源:__init__.py


示例8: __init__

    def __init__(self, parent,
                 search_text = r"# ?TODO|# ?FIXME|# ?XXX",
                 search_text_regexp=True, search_path=None,
                 include=[".", ".py"], include_idx=None, include_regexp=True,
                 exclude=r"\.pyc$|\.orig$|\.hg|\.svn", exclude_idx=None,
                 exclude_regexp=True,
                 supported_encodings=("utf-8", "iso-8859-1", "cp1252"),
                 in_python_path=False, more_options=False):
        QWidget.__init__(self, parent)
        
        self.setWindowTitle(_('Find in files'))

        self.search_thread = None
        self.get_pythonpath_callback = None
        
        self.find_options = FindOptions(self, search_text, search_text_regexp,
                                        search_path,
                                        include, include_idx, include_regexp,
                                        exclude, exclude_idx, exclude_regexp,
                                        supported_encodings, in_python_path,
                                        more_options)
        self.connect(self.find_options, SIGNAL('find()'), self.find)
        self.connect(self.find_options, SIGNAL('stop()'),
                     self.stop_and_reset_thread)
        
        self.result_browser = ResultsBrowser(self)
        
        collapse_btn = create_toolbutton(self)
        collapse_btn.setDefaultAction(self.result_browser.collapse_all_action)
        expand_btn = create_toolbutton(self)
        expand_btn.setDefaultAction(self.result_browser.expand_all_action)
        restore_btn = create_toolbutton(self)
        restore_btn.setDefaultAction(self.result_browser.restore_action)
#        collapse_sel_btn = create_toolbutton(self)
#        collapse_sel_btn.setDefaultAction(
#                                self.result_browser.collapse_selection_action)
#        expand_sel_btn = create_toolbutton(self)
#        expand_sel_btn.setDefaultAction(
#                                self.result_browser.expand_selection_action)
        
        btn_layout = QVBoxLayout()
        btn_layout.setAlignment(Qt.AlignTop)
        for widget in [collapse_btn, expand_btn, restore_btn]:
#                       collapse_sel_btn, expand_sel_btn]:
            btn_layout.addWidget(widget)
        
        hlayout = QHBoxLayout()
        hlayout.addWidget(self.result_browser)
        hlayout.addLayout(btn_layout)
        
        layout = QVBoxLayout()
        left, _x, right, bottom = layout.getContentsMargins()
        layout.setContentsMargins(left, 0, right, bottom)
        layout.addWidget(self.find_options)
        layout.addLayout(hlayout)
        self.setLayout(layout)
开发者ID:jromang,项目名称:retina-old,代码行数:56,代码来源:findinfiles.py


示例9: get_toolbar_buttons

 def get_toolbar_buttons(self):
     self.run_button = create_toolbutton(self, get_icon('run.png'),
                           self.tr("Run"),
                           tip=self.tr("Run again this program"),
                           triggered=self.start)
     self.kill_button = create_toolbutton(self, get_icon('kill.png'),
                           self.tr("Kill"),
                           tip=self.tr("Kills the current process, "
                                       "causing it to exit immediately"))
     return [self.run_button, self.kill_button]
开发者ID:Brainsciences,项目名称:luminoso,代码行数:10,代码来源:__init__.py


示例10: __init__

    def __init__(self, parent):
        ReadOnlyEditor.__init__(self, parent)
        
        self.shell = None
        
        self.external_console = None
        
        # locked = disable link with Console
        self.locked = False
        self._last_text = None
        
        # Object name
        layout_edit = QHBoxLayout()
        layout_edit.addWidget(QLabel(self.tr("Object")))
        self.combo = ObjectComboBox(self)
        layout_edit.addWidget(self.combo)
        self.combo.setMaxCount(CONF.get(self.ID, 'max_history_entries'))
        self.combo.addItems( self.load_history() )
        self.connect(self.combo, SIGNAL("valid(bool)"),
                     lambda valid: self.force_refresh())
        
        # Doc/source option
        help_or_doc = create_action(self, self.tr("Show source"),
                                    toggled=self.toggle_help)
        help_or_doc.setChecked(False)
        self.docstring = True
        
        # Automatic import option
        auto_import = create_action(self, self.tr("Automatic import"),
                                    toggled=self.toggle_auto_import)
        auto_import_state = CONF.get('inspector', 'automatic_import')
        auto_import.setChecked(auto_import_state)
        
        # Lock checkbox
        self.locked_button = create_toolbutton(self,
                                               triggered=self.toggle_locked)
        layout_edit.addWidget(self.locked_button)
        self._update_lock_icon()
        
        # Option menu
        options_button = create_toolbutton(self, text=self.tr("Options"),
                                           icon=get_icon('tooloptions.png'))
        options_button.setPopupMode(QToolButton.InstantPopup)
        menu = QMenu(self)
        add_actions(menu, [help_or_doc, auto_import])
        options_button.setMenu(menu)
        layout_edit.addWidget(options_button)

        # Main layout
        layout = QVBoxLayout()
        layout.addLayout(layout_edit)
        layout.addWidget(self.editor)
        layout.addWidget(self.find_widget)
        self.setLayout(layout)
开发者ID:cheesinglee,项目名称:spyder,代码行数:54,代码来源:inspector.py


示例11: setup_buttons

 def setup_buttons(self):
     fromcursor_btn = create_toolbutton(self, get_icon("fromcursor.png"),
                      tip=translate('ClassBrowser', 'Go to cursor position'),
                      triggered=self.treewidget.go_to_cursor_position)
     collapse_btn = create_toolbutton(self, text_beside_icon=False)
     collapse_btn.setDefaultAction(self.treewidget.collapse_selection_action)
     expand_btn = create_toolbutton(self, text_beside_icon=False)
     expand_btn.setDefaultAction(self.treewidget.expand_selection_action)
     restore_btn = create_toolbutton(self, text_beside_icon=False)
     restore_btn.setDefaultAction(self.treewidget.restore_action)
     return (fromcursor_btn, collapse_btn, expand_btn, restore_btn)
开发者ID:cheesinglee,项目名称:spyder,代码行数:11,代码来源:editortools.py


示例12: setup_buttons

 def setup_buttons(self):
     fromcursor_btn = create_toolbutton(self,
                          icon=get_icon("fromcursor.png"),
                          tip=_('Go to cursor position'),
                          triggered=self.treewidget.go_to_cursor_position)
     collapse_btn = create_toolbutton(self)
     collapse_btn.setDefaultAction(self.treewidget.collapse_selection_action)
     expand_btn = create_toolbutton(self)
     expand_btn.setDefaultAction(self.treewidget.expand_selection_action)
     restore_btn = create_toolbutton(self)
     restore_btn.setDefaultAction(self.treewidget.restore_action)
     return (fromcursor_btn, collapse_btn, expand_btn, restore_btn)
开发者ID:jromang,项目名称:retina-old,代码行数:12,代码来源:editortools.py


示例13: __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


示例14: __init__

    def __init__(self, parent, actions=None, menu=None,
                 corner_widgets=None, menu_use_tooltips=False):
        QTabWidget.__init__(self, parent)
        self.setUsesScrollButtons(True)

        # To style tabs on Mac
        if sys.platform == 'darwin':
            self.setObjectName('plugin-tab')

        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=ima.icon('browse_tab'),
                                          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:MarvinLiu0810,项目名称:spyder,代码行数:34,代码来源:tabs.py


示例15: __init__

    def __init__(self, parent):
        self.tabwidget = None
        self.menu_actions = None
        self.dockviewer = None
        
        self.editors = []
        self.filenames = []
        self.icons = []
        
        SpyderPluginWidget.__init__(self, parent)
        
        layout = QVBoxLayout()
        self.tabwidget = Tabs(self, self.menu_actions)
        self.connect(self.tabwidget, SIGNAL('currentChanged(int)'),
                     self.refresh_plugin)
        self.connect(self.tabwidget, SIGNAL('move_data(int,int)'),
                     self.move_tab)
        layout.addWidget(self.tabwidget)

        # Menu as corner widget
        options_button = create_toolbutton(self, text=self.tr("Options"),
                                           icon=get_icon('tooloptions.png'))
        options_button.setPopupMode(QToolButton.InstantPopup)
        menu = QMenu(self)
        add_actions(menu, self.menu_actions)
        options_button.setMenu(menu)
        self.tabwidget.setCornerWidget(options_button)
        
        # Find/replace widget
        self.find_widget = FindReplace(self)
        self.find_widget.hide()
        layout.addWidget(self.find_widget)
        
        self.setLayout(layout)
开发者ID:cheesinglee,项目名称:spyder,代码行数:34,代码来源:history.py


示例16: __init__

    def __init__(self, parent,
                 search_text = r"# ?TODO|# ?FIXME|# ?XXX",
                 search_text_regexp=True, search_path=None,
                 include=".", include_regexp=True,
                 exclude=r"\.pyc$|\.orig$|\.hg|\.svn", exclude_regexp=True,
                 supported_encodings=("utf-8", "iso-8859-1", "cp1252")):
        QWidget.__init__(self, parent)

        self.search_thread = SearchThread(self)
        self.connect(self.search_thread, SIGNAL("finished()"),
                     self.search_complete)
        
        self.find_options = FindOptions(self, search_text, search_text_regexp,
                                        search_path, include, include_regexp,
                                        exclude, exclude_regexp,
                                        supported_encodings)
        self.connect(self.find_options, SIGNAL('find()'), self.find)
        self.connect(self.find_options, SIGNAL('stop()'), self.stop)
        
        self.result_browser = ResultsBrowser(self)
        
        collapse_btn = create_toolbutton(self, get_icon("collapse.png"),
                                 tip=translate('FindInFiles', "Collapse all"),
                                 triggered=self.result_browser.collapseAll)
        expand_btn = create_toolbutton(self, get_icon("expand.png"),
                                 tip=translate('FindInFiles', "Expand all"),
                                 triggered=self.result_browser.expandAll)
        restore_btn = create_toolbutton(self, get_icon("restore.png"),
                                 tip=translate('FindInFiles',
                                               "Restore original tree layout"),
                                 triggered=self.result_browser.restore)
        btn_layout = QVBoxLayout()
        btn_layout.setAlignment(Qt.AlignTop)
        for widget in [collapse_btn, expand_btn, restore_btn]:
            btn_layout.addWidget(widget)
        
        hlayout = QHBoxLayout()
        hlayout.addWidget(self.result_browser)
        hlayout.addLayout(btn_layout)
        
        layout = QVBoxLayout()
        left, _, right, bottom = layout.getContentsMargins()
        layout.setContentsMargins(left, 0, right, bottom)
        layout.addWidget(self.find_options)
        layout.addLayout(hlayout)
        self.setLayout(layout)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:46,代码来源:findinfiles.py


示例17: get_toolbar_buttons

 def get_toolbar_buttons(self):
     ExternalShellBase.get_toolbar_buttons(self)
     self.globalsexplorer_button = create_toolbutton(self,
                       get_icon('dictedit.png'), self.tr("Variables"),
                       tip=self.tr("Show/hide global variables explorer"),
                       toggled=self.toggle_globals_explorer)
     self.terminate_button = create_toolbutton(self,
           get_icon('terminate.png'), self.tr("Terminate"),
           tip=self.tr("Attempts to terminate the process.\n"
                       "The process may not exit as a result of clicking "
                       "this button\n(it is given the chance to prompt "
                       "the user for any unsaved files, etc)."))        
     self.interact_check = QCheckBox(self.tr("Interact"), self)
     self.debug_check = QCheckBox(self.tr("Debug"), self)
     return [self.interact_check, self.debug_check,
             self.globalsexplorer_button, self.run_button,
             self.terminate_button, self.kill_button]
开发者ID:Brainsciences,项目名称:luminoso,代码行数:17,代码来源:pythonshell.py


示例18: __init__

    def __init__(self, parent):
        self.tabwidget = None
        self.menu_actions = None
        self.dockviewer = None
        self.wrap_action = None
        
        self.editors = []
        self.filenames = []
        self.icons = []
        if PYQT5:        
            SpyderPluginWidget.__init__(self, parent, main = parent)
        else:
            SpyderPluginWidget.__init__(self, parent)

        # Initialize plugin
        self.initialize_plugin()
        
        self.set_default_color_scheme()
        
        layout = QVBoxLayout()
        self.tabwidget = Tabs(self, self.menu_actions)
        self.tabwidget.currentChanged.connect(self.refresh_plugin)
        self.tabwidget.move_data.connect(self.move_tab)

        if sys.platform == 'darwin':
            tab_container = QWidget()
            tab_container.setObjectName('tab-container')
            tab_layout = QHBoxLayout(tab_container)
            tab_layout.setContentsMargins(0, 0, 0, 0)
            tab_layout.addWidget(self.tabwidget)
            layout.addWidget(tab_container)
        else:
            layout.addWidget(self.tabwidget)

        self.tabwidget.setStyleSheet("QTabWidget::pane {border: 0;}")

        # Menu as corner widget
        options_button = create_toolbutton(self, text=_('Options'),
                                           icon=ima.icon('tooloptions'))
        options_button.setPopupMode(QToolButton.InstantPopup)
        menu = QMenu(self)
        add_actions(menu, self.menu_actions)
        options_button.setMenu(menu)
        self.tabwidget.setCornerWidget(options_button)
        
        # Find/replace widget
        self.find_widget = FindReplace(self)
        self.find_widget.hide()
        self.register_widget_shortcuts("Editor", self.find_widget)
        
        layout.addWidget(self.find_widget)
        
        self.setLayout(layout)
开发者ID:Codemon88,项目名称:spyder,代码行数:53,代码来源:history.py


示例19: setup_bottom_toolbar

 def setup_bottom_toolbar(self, layout):
     toolbar = []
     add_button = create_toolbutton(self, text=self.tr("Add path"),
                                    icon=get_icon('edit_add.png'),
                                    triggered=self.add_path)
     toolbar.append(add_button)
     remove_button = create_toolbutton(self, text=self.tr("Remove path"),
                                       icon=get_icon('edit_remove.png'),
                                       triggered=self.remove_path)
     toolbar.append(remove_button)
     self.selection_widgets.append(remove_button)
     self._add_widgets_to_layout(layout, toolbar)
     layout.addStretch(1)
     if os.name == 'nt':
         self.sync_button = create_toolbutton(self,
               text=self.tr("Synchronize..."),
               icon=get_icon('synchronize.png'), triggered=self.synchronize,
               tip=self.tr("Synchronize Spyder's path list with PYTHONPATH "
                           "environment variable"))
         layout.addWidget(self.sync_button)
     return toolbar
开发者ID:Brainsciences,项目名称:luminoso,代码行数:21,代码来源:pathmanager.py


示例20: set_close_function

 def set_close_function(self, func):
     """Setting Tabs close function
     None -> tabs are not closable"""
     state = func is not None
     if state:
         self.sig_close_tab.connect(func)
     try:
         # Assuming Qt >= 4.5
         QTabWidget.setTabsClosable(self, state)
         self.tabCloseRequested.connect(func)
     except AttributeError:
         # Workaround for Qt < 4.5
         close_button = create_toolbutton(self, triggered=func,
                                          icon=ima.icon('fileclose'),
                                          tip=_("Close current tab"))
         self.setCornerWidget(close_button if state else None)
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:16,代码来源:tabs.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python qthelpers.get_icon函数代码示例发布时间:2022-05-27
下一篇:
Python qthelpers.create_action函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap