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


Python QComboBox.hide方法代码示例

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


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

示例1: Help

# 需要导入模块: from qtpy.QtWidgets import QComboBox [as 别名]
# 或者: from qtpy.QtWidgets.QComboBox import hide [as 别名]
class Help(SpyderPluginWidget):
    """
    Docstrings viewer widget
    """
    CONF_SECTION = 'help'
    CONFIGWIDGET_CLASS = HelpConfigPage
    LOG_PATH = get_conf_path(CONF_SECTION)
    FONT_SIZE_DELTA = DEFAULT_SMALL_DELTA

    # Signals
    focus_changed = Signal()

    def __init__(self, parent):
        if PYQT5:
            SpyderPluginWidget.__init__(self, parent, main = parent)
        else:
            SpyderPluginWidget.__init__(self, parent)

        self.internal_shell = None

        # Initialize plugin
        self.initialize_plugin()

        self.no_doc_string = _("No further documentation available")

        self._last_console_cb = None
        self._last_editor_cb = None

        self.plain_text = PlainText(self)
        self.rich_text = RichText(self)

        color_scheme = self.get_color_scheme()
        self.set_plain_text_font(self.get_plugin_font(), color_scheme)
        self.plain_text.editor.toggle_wrap_mode(self.get_option('wrap'))

        # Add entries to read-only editor context-menu
        self.wrap_action = create_action(self, _("Wrap lines"),
                                         toggled=self.toggle_wrap_mode)
        self.wrap_action.setChecked(self.get_option('wrap'))
        self.plain_text.editor.readonly_menu.addSeparator()
        add_actions(self.plain_text.editor.readonly_menu, (self.wrap_action,))

        self.set_rich_text_font(self.get_plugin_font('rich_text'))

        self.shell = None

        self.external_console = None

        # locked = disable link with Console
        self.locked = False
        self._last_texts = [None, None]
        self._last_editor_doc = None

        # Object name
        layout_edit = QHBoxLayout()
        layout_edit.setContentsMargins(0, 0, 0, 0)
        txt = _("Source")
        if sys.platform == 'darwin':
            source_label = QLabel("  " + txt)
        else:
            source_label = QLabel(txt)
        layout_edit.addWidget(source_label)
        self.source_combo = QComboBox(self)
        self.source_combo.addItems([_("Console"), _("Editor")])
        self.source_combo.currentIndexChanged.connect(self.source_changed)
        if (not programs.is_module_installed('rope') and
                not programs.is_module_installed('jedi', '>=0.8.1')):
            self.source_combo.hide()
            source_label.hide()
        layout_edit.addWidget(self.source_combo)
        layout_edit.addSpacing(10)
        layout_edit.addWidget(QLabel(_("Object")))
        self.combo = ObjectComboBox(self)
        layout_edit.addWidget(self.combo)
        self.object_edit = QLineEdit(self)
        self.object_edit.setReadOnly(True)
        layout_edit.addWidget(self.object_edit)
        self.combo.setMaxCount(self.get_option('max_history_entries'))
        self.combo.addItems( self.load_history() )
        self.combo.setItemText(0, '')
        self.combo.valid.connect(lambda valid: self.force_refresh())

        # Plain text docstring option
        self.docstring = True
        self.rich_help = self.get_option('rich_mode', True)
        self.plain_text_action = create_action(self, _("Plain Text"),
                                               toggled=self.toggle_plain_text)

        # Source code option
        self.show_source_action = create_action(self, _("Show Source"),
                                                toggled=self.toggle_show_source)

        # Rich text option
        self.rich_text_action = create_action(self, _("Rich Text"),
                                         toggled=self.toggle_rich_text)

        # Add the help actions to an exclusive QActionGroup
        help_actions = QActionGroup(self)
        help_actions.setExclusive(True)
        help_actions.addAction(self.plain_text_action)
#.........这里部分代码省略.........
开发者ID:ShenggaoZhu,项目名称:spyder,代码行数:103,代码来源:help.py

示例2: SlitSelectionUI

# 需要导入模块: from qtpy.QtWidgets import QComboBox [as 别名]
# 或者: from qtpy.QtWidgets.QComboBox import hide [as 别名]

#.........这里部分代码省略.........

    @property
    def length_units(self):
        return u.Unit(self.slit_length_units.text())

    def update_info(self, index):
        """
        Update width and hight based on combo index.
        Callback for combo box.
        """
        key = self.slit_type_combo.currentData()

        length = width = None
        width_units = length_units = ''
        if key == 'default':
            slit_info = self.mosviz_viewer.get_slit_dimensions_from_file()
            width_units, length_units = self.mosviz_viewer.get_slit_units_from_file()
            if slit_info is None:
                length, width = ['N/A', 'N/A']
            else:
                length, width = slit_info
        elif key != 'custom':
            if 'length' in self.slit_dict[key]:
                length = self.slit_dict[key]['length']
            if 'width' in self.slit_dict[key]:
                width = self.slit_dict[key]['width']
        else:
            width_units = length_units = 'arcsec'

        for input_widget in [self.slit_width_input, self.slit_length_input]:
            input_widget.setStyleSheet("")

        if isinstance(width, list):
            self.slit_width_input.hide()
            self.slit_width_combo.show()
            combo_input = [(str(i), str(i)) for i in width]
            update_combobox(self.slit_width_combo, combo_input)
        elif width is None:
            self.slit_width_combo.hide()
            self.slit_width_input.show()
            self.slit_width_input.setText('')
            self.slit_width_input.setDisabled(False)
        else:
            self.slit_width_combo.hide()
            self.slit_width_input.show()
            self.slit_width_input.setText(str(width))
            self.slit_width_input.setDisabled(True)
        self.slit_width_units.setText(width_units)

        if isinstance(length, list):
            self.slit_length_input.hide()
            self.slit_length_combo.show()
            combo_input = [(str(i), str(i)) for i in length]
            update_combobox(self.slit_length_combo, combo_input)
        elif length is None:
            self.slit_length_combo.hide()
            self.slit_length_input.show()
            self.slit_length_input.setText('')
            self.slit_length_input.setDisabled(False)
        else:
            self.slit_length_combo.hide()
            self.slit_length_input.show()
            self.slit_length_input.setText(str(length))
            self.slit_length_input.setDisabled(True)
        self.slit_length_units.setText(length_units)
开发者ID:spacetelescope,项目名称:mosviz,代码行数:69,代码来源:slit_selection_ui.py


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